Re: [gama (10249)] Different simulation results between GUI and batch experiment

52 views
Skip to first unread message

Benoit Gaudou

unread,
Dec 6, 2021, 11:49:52 AM12/6/21
to gama-p...@googlegroups.com
Dear,

Just to be sure,  have  you launched several simulations in  each mode and observed  the  same patterns in each case ?

Cheers

Benoit

Le mar. 30 nov. 2021 à 16:44, Ahyoung Lim <ahyoun...@gmail.com> a écrit :
**Following my previous inquiry**

Thanks Benoit for the explanation on the batch experiment! I'm trying to do batch experiments and it improves the speed indeed. 

However, the simulation output from GUI and batch experiments are totally different and I'm still not sure why. 

For example, I have created a variable to count the number of agents and save the number per day to CSV file. The number of agents per day from GUI and batch experiments are totally different (please see the figure below). fig.png 

I have tried without using parallelism but it didn't work. I'm creating a scheduler species to execute the agent's behaviors in parallel  - does this possibly affect the process of the batch experiment? 


Here's a part of my code.

global{ 
int currHour;
int current_date;
bool parallel <- false;
int nb_mosquito <- 5000 update: mosquito count(each.age>=0);

init { 
create scheduler;
create mosquito number: nb_mosquito ;
initializationStartTime <- machine_time;


reflex setDay { 
  currHour <- int(cycle mod 4);
    if cycle > 0 and currHour 0 { 
    do saveOutput;
     } 

action saveOutput { 
save [ current_date, nb_mosquito] to: "../result/sim" + initializationStartTime + ".csv" type: "csv" rewrite:false header:false;



species scheduler parallel:parallel { 
   reflex mosquito_scheduler { 
      ask mosquito parallel:: parallel { 
      do feeding; 
       } 
      ask mosquito parallel:: parallel { 
      do reproduce;
       }
}
}

species mosquito skills: [moving] { 
action feeding { 
...
action reproduce { 
...
}

experiment batch type: batch repeat:1 keep_seed: false until: cycle>360{ 


Any comments or ideas? Many thanks for your time and help. 

Best, 

Ahyoung
  

--
You received this message because you are subscribed to the Google Groups "GAMA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gama-platfor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gama-platform/df50d653-45f1-45d6-bfee-75034232553bn%40googlegroups.com.

Ahyoung Lim

unread,
Dec 7, 2021, 3:09:25 AM12/7/21
to GAMA
Dear Benoit,

Yes I ran each simulation several times. 

In fact, I figured out the reason - one of the parameters affecting the number of agents was not turned on in the global section but only in the GUI experiment section. 

Thank you for your response!

Ahyoung


2021년 12월 7일 화요일 오전 1시 49분 52초 UTC+9에 Benoit Gaudou님이 작성:
Reply all
Reply to author
Forward
0 new messages