ñòð. 111 |

: ++++++++++++++++++++++++++++++++++++++++++++++++++++++

:rule r17

rule block 3 (goal Set final classification to setosa)

IF (in Iris species is setosa)

THEN in 1 final is "Iris-setosa";

:rule r18

TEAM LinG - Live, Informative, Non-cost and Genuine !

323

APPENDIX

rule block 3 (goal Set final classification to

versicolor)

IF (in Iris species is versicolor)

THEN in 1 final is "Iris-versicolor";

:rule r19

rule block 3 (goal Set final classification to

virginica)

IF (in Iris species is virginica)

THEN in 1 final is "Iris-virginica";

:rule r20

rule block 3 (goal activate next block)

IF (True) THEN

fire block 3 off,

fire block 4 on;

: ++++++++++++++++++++++++++++++++++++++++++++++++++++++

:rule r21

rule block 4 (goal detect incorrect classifications)

IF (in Iris N = <N> AND final = <FL> AND orig = <ORIG>

AND final <> <ORIG>)

THEN

prmem 1,

message "Specimen <N> incorrect\: <FL> should be <ORIG>\n" ;

:rule r22

rule block 4 (goal detect unclassified specimens)

IF (in Iris N = <N> AND final.cf = 0 OR (species.setosa =

0 AND species.versicolor = 0 AND species.virginica = 0))

(in IrisData N = <N>)

THEN

prmem 1,

prmem 2,

message "Specimen <N> unclassified\n";

: ++++++++++++++++++++++++++++++++++++++++++++++++++++++

:transfer -conf IrisData from iristest.dat;

transfer -conf IrisData from Iris.dat;

fire all off;

fire block 0 on;

TMSoff;

TestFsetOff;

make True;

TEAM LinG - Live, Informative, Non-cost and Genuine !

324 APPENDIX

message "Block 0 first creates memory instances of each

specimen";

run 1;

message "Block 0 now fuzzifies the input data";

run 1;

message "Block 1 gets preliminary classifications for

each specimen";

run 1;

message "Block 2 aggregates preliminary

classifications";

run 1;

message "Block 3 gets final classifications";

run 1;

message "Block 42 checks for incorrect classifications

and specimens not classified";

run 1;

message "IRIS.PAR finished";

exit;

: program LOGIST.fps - solves differential equation of

logistic growth.

declare Population

size ï¬‚t :population size

K ï¬‚t :carrying capacity

r ï¬‚t :growth rate of individual

T ï¬‚t :time

TMax ï¬‚t : max time allowed for continued run

dT ï¬‚t :delta time

dPdT ï¬‚t :growth rate of population

terminate ï¬‚t; :minimum population growth rate to

continue run

:rule r0

rule (goal Calculate population growth rate dPdT at

time T)

IF (in Population size = <size> AND K = <K> AND r = <r>

AND T = <T> AND dT = <dT> AND dPdT.cf = 0)

THEN

write "Time <T> population <size>\n",

in 1 dPdT = (<r> * <size> * <dT> * (1 - <size> / <K>)),

in 1 T = (<T> + <dT>);

:rule r1

TEAM LinG - Live, Informative, Non-cost and Genuine !

325

APPENDIX

rule (goal Calculate population size at T+dT from size

at T recursively)

IF (in Population size = <size> AND K = <K> AND r = <r>

AND T = <T> AND dT = <dT> AND dPdT = <dPdT>

AND terminate < <dPdT> AND TMax > <T>)

THEN

in 1 size = (<size> + <dPdT> * <dT>),

in 1 dPdT.cf = 0;

:rule r2

rule (goal Terminate run)

IF (in Population (T = <T> AND TMax < <T>) OR (dPdT =

<dPdT> AND terminate > <dPdT>))

THEN

write "Termination criterion met - ending run\n",

halt;

make Population size = 1000 K = 10000 r = 1 T = 0 TMax =

10 dT = 1 terminate = 0.01;

: program LOGIST.par - solves differential equation of

logistic growth.

declare Population

size ï¬‚t :population size

K ï¬‚t :carrying capacity

r ï¬‚t :growth rate of individual

ñòð. 111 |