modify step during simulation

34 views
Skip to first unread message

Achim Gädke

unread,
Apr 8, 2014, 7:11:16 PM4/8/14
to gama-p...@googlegroups.com
Hi there!

As human activity is often a bit less busy at night, I got the idea of switching step from 30s to 10min (or similar) during night.
I wonder whether this has any side effects? Is step a global variable or something very special (as it is listed as a keyword)?

Right now I'm scheduling agents less often, but evaluating the scheduling of 100k agents costs some time, so I'm keen on avoiding this overhead time.

Any thoughts?

Cheers, Achim

Duc An Vo

unread,
Apr 8, 2014, 8:07:52 PM4/8/14
to gama-p...@googlegroups.com
Hi Achim,

In the definition of species, the "frequency" and "schedules" facets can be use to tune the scheduling frequency and the target agents (of species) to be scheduled. Please have a look at here for more detail.

In the "world" agent (defined by the "global" section), you find some interesting "temporal" variables such as cycle, step, time. Please have a look at here for more detail.

So in your case, to tune the scheduling frequency of your human agents, in the definition of "frequency" and/or "schedules" facets of human species, you can decide that the human agents are scheduled less often at night (i.e., night can be determined thanks to the time variable).

Cheers,
An.


--
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 post to this group, send email to gama-p...@googlegroups.com.
Visit this group at http://groups.google.com/group/gama-platform.
For more options, visit https://groups.google.com/d/optout.

Duc An Vo

unread,
Apr 8, 2014, 8:23:55 PM4/8/14
to gama-p...@googlegroups.com
Hi again,

Concerning the side effects, when agents are not scheduled in a simulation steps, their variables and behaviors (e.g., reflexes) are not evaluated/updated and executed in that simulation step.

Opting for a scheduling strategy depends largely on your model. 

When you have a lot of agents during the simulation (e.g., 100k in your case) and you find that during some periods of the simulation, these agents don't change status (a lot) (e.g., humans sleep at night), you can decide to schedule them less often (or may be un-schedule them) during these times to speed up the simulation.

But if your agents are very active (it 's important to update their variables and execute their behaviors) and you schedule them less often, this may affect the "accuracy" of your simulation outcome.

Cheers,
An.

Achim Gädke

unread,
Apr 8, 2014, 9:46:44 PM4/8/14
to gama-p...@googlegroups.com
Hi there!

Thanks for all the hints.

I think, I'd like to change the value of the 'frequency' facet, for time periods with no need need for a fine grain time pattern, or have an expression which is evaluated for a species and not for each agent of the species (like schedules does). The schedule statement becomes expensive for large number of agents so I try to avoid the evaluation of it.

Maybe I should try something like returning an empty list if a condition becomes true otherwise a reference to the list of agents (is this avoiding a copy)?

species myspecies schedules: (expression)?(myspecies):[] {
}

Cheers, Achim

Alexis Drogoul

unread,
Apr 9, 2014, 5:19:05 AM4/9/14
to gama-p...@googlegroups.com
Well.. My guess is that it is possible to define different values of step during the day and during the night.

reflex change_step {
step <- (is_day(time)) ? 10 °min : 2 °hour);

}

You have to take this into account, of course, in your different behaviors, etc. but I dont see any reason why it wouldn’t work.
> --
> 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 post to this group, send email to gama-p...@googlegroups.com.
> Visit this group at http://groups.google.com/group/gama-platform.
> For more options, visit https://groups.google.com/d/optout.

--
Senior Researcher, UMI UMMISCO 209, IRD & UPMC, France.
Invited Researcher, DREAM, Can Tho University, Viet Nam.
--
alexis....@gmail.com | http://tiny.cc/liqemw
[Vietnam] +84915088155 [France] +33608698845
--
GAMA: https://code.google.com/p/gama-platform/

Reply all
Reply to author
Forward
0 new messages