150
X-Machines for Agent-Based Modeling: FLAME Perspectives
newmutantChild=0;
for(i=0;i {
if(compare_arrays(&FIRM_STRATEGY_MAP[i].output,
&mutantChild.output)==0)//true
{
newmutantChild=1;
}
}
if(newmutantChild==0)
{
for(i=0;i {
lowest=FIRM_STRATEGY_MAP[0].score;
pos=0;
for(j=0;j {
if(lowest>FIRM_STRATEGY_MAP[j].score)
{
lowest=FIRM_STRATEGY_MAP[j].score;
pos=j;
}
}
for(l=0;l {
FIRM_STRATEGY_MAP[pos].output[l]=mutantChild.output[l];
}
FIRM_STRATEGY_MAP[pos].score=THRESHOLD;
}
}
}//end if mutate
}//end if(CURRENT_STRATEGY.score>=THRESHOLD)
for(i=0;i {
total_fitness+=FIRM_STRATEGY_MAP[i].score;
}
AVG_FITNESS_OPT=total_fitness/FirmBoardSize;
return 0;
}
6.3.2 Filtering Messages in Advance
Messages can be filtered in advance at message boards, before functions
start reading them. This is handled by FLAME if defined in the XML description file. The C function stays exactly the same, but speeds up simulation time
in cases where a large number of messages are read to find particular values.

Firm_select_strategy
00
00a
Précédent

- 179/329

Suivant