Defaults to NA_character_ which means, no stop condition is applied. Simulations are automatically stopped if TRUE is reported. stopcond - a NetLogo reporter that reports true/false.runtime - an integer that defines the maximum number of ticks that are simulated.The runtime of NetLogo model simulations can be controlled with two slots of the experiment class: Otherwise, set the experiment repetition to 1 and increase the nseeds variable of your desired simdesign. In summary, if you set the random-seed of your NetLogo model manually, you can increase the repitition of the experiment to run several simulations with equal parameterization and different random seeds. Thus we suggest to set the experiment repetition to 1 and instead use the nseeds variable of the desired simdesign to run multiple simulations with different random seeds. You can then observe the effect of stochasticity on the level of your final output, the sensitivity indices. Here, you may want to exclude stochasticity from your output and instead do multiple sensitivity analyses with the same parameter matrix but different random seeds. However, the concept of nlrx is based on sensitivity analyses. If your model does not reset the random seed manually, the seed will always be the same for each repetition. By default, the NetLogo random-seed is set by the simdesign that is attached to your nl object. This is only useful if you manually generate a new random-seed during the setup of your model. The experiment provides a slot called “repetition” which allows to run multiple simulations of one parameterization. These output files can then be monitored to capture the progress of the parallelized model executions. If such functionality is needed, we suggest to write the current progress to an output file directly from NetLogo (for example using the idrunnum functionality of nlrx, see section “Notes on self-written output”). Another possibility is, to define a print reporter procedure in the experiment slot “idfinal” that is executed at the end of each simulation.Ĭapturing output from multiple processes in parallelized environments to one R console is not straightforward. Thus, print commands can be used within the NetLogo model code to display the current progress of simulations in the R console. In addition, NetLogo print commands are redirected to the R console. The run_nl_one() does not report any progress because it only executes one simulation. However, dynamic experiments are difficult to track because it is not clear how long the complete experiment will take from the beginning. The run_nl_dyn() function might provide progress output depending on the chosen method (for example ABC offers a progress bar). Progressr :: handlers( "progress") results <- progressr :: with_progress( run_nl_all(nl)) The function will report detailed warnings or error messages, if definitions of variables or constants are invalid. After attaching an experiment to an nl object, validity of defined experiment variables and constants can be checked by commiting the nl object to the function eval_variables_constants(). This function reads all GUI elements of the NetLogo model that can be set by nlrx. If your model does not have any globals (GUI and code), please create a dummy global (either create a global widget on the GUI or add a dummy variable to the globals code section) for your model and put it in the constants list with an appropriate value.Ī complete list of all valid NetLogo parameters can be loaded by commiting a nl object with a valid modelpath to the function report_model_parameters(). simdesign_simple() requires at least one defined constant within the constants list.NetLogo model parameters that are not listed in any of these two lists will be set with their default value from the NetLogo model interface.It is not allowed to list the same variable in the variables and constants list.Variable values that should be recognized by NetLogo as logical need to be entered as strings (e.g.Variable values that should be recognized by NetLogo as strings need to be nested inside escaped quotes (e.g.Categorical variable values are currently only allowed for simdesign_simple, simdesign_distinct and simdesign_ff.Values, or min, max, step (values is prioritized)Īdditionally, please note the following restrictions in order to define variables and constants correctly: The implemented simdesigns have different requirements for variable definitions: Simdesign Correctly defining variables within the experiment class object is crucial for creating simdesigns.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |