
add-behaviourĪdd-behaviour micro-behaviour adds the micro-behaviour to the current agent (the prototype running the micro-behaviour that is executing the add-behaviour command). If odds i that together with the odds j where j < i adds up to more than 1.0 then only the portion of odds i that adds up to 1.0 is used. do-with-probabilitiesĭo-with-probabilities odds 1 odds 2 … odds n performsīehaviour i with probability of odds i. do-with-probabilityĭo-with-probability odds performs actions with probability odds. When n is an integer this is identical to the NetLogo repeat reporter. It selects the-encounter-rate of those not dead and adds the POSSIBLE-INFECTION micro-behaviour.ĭo-repeatedly n performs actions n times (if n is a non-integer then the actions may be performed an additional time where the odds are the fractional part of n). select-n is a reporter that returns n agents and also treats fractions probabilistically.Ī typical example is from RANDOM_ENCOUNTER: do-every 1Īll-individuals with
#Netlogo random number code
While the actions are run the code can refer to the agent that is running do-for-n using the-other. If there are fewer than n agents then all agents run the actions. If n is a non-integer the remainder is used as the odds of selecting an additional agent. Selects n of the agents and runs actions for each agent. This is useful when you want a subset of agents to perform some action. do-if-elseĭo-if-else Īdds micro-behaviour t1 micro-behaviour t2 … micro-behaviour tn if condition reports true otherwise it adds micro-behaviour f1 micro-behaviour f2 … micro-behaviour fn. Whenever performs actions every time condition is true ( actions can be any NetLogo commands condition any NetLogo reporter that returns true or false). When performs actions one time as soon as condition holds ( actions can be any NetLogo commands condition any NetLogo reporter that returns true or false). do-nowĭo-now performs actions immediately ( actions can be any NetLogo commands). do-at-timeĭo-at-time time performs actions when the clock has reached time ( actions can be any NetLogo commands and time can be any number). do-afterĭo-after interval performs actions after interval time units ( actions can be any NetLogo commands interval any positive number). do-after-setupĭo-after-setup performs actions just after the simulation is initialised ( actions can be any NetLogo commands). do-at-setupĭo-at-setup performs actions when the simulation is initialised ( actions can be any NetLogo commands). do-every-dynamic do-every-dynamic performs actions now and repeats them after an interval computed by running the i nterval-reporter ( actions can be any NetLogo commands).

