sierra.plugins.engine.argos.variables.population_constant_density#
Classes for the constant population density batch criteria.
See Population Constant Density for usage documentation.
Classes#
Defines XML changes for maintain population density across arena sizes. |
Module Contents#
- class sierra.plugins.engine.argos.variables.population_constant_density.PopulationConstantDensity(*args, **kwargs)[source]#

Defines XML changes for maintain population density across arena sizes.
This class is a base class which should (almost) never be used on its own. Instead, the
factory()function should be used to dynamically create derived classes expressing the user's desired density.Does not change the # blocks/block manifest.
- arena_dims(cmdopts: sierra.core.types.Cmdopts) list[sierra.core.utils.ArenaExtent]#
Get the arena dimensions used for each experiment in the batch.
Not applicable to all criteria.
Must be implemented on a per-engine basis, as different engines have different means of computing the size of the arena.
- exp_scenario_name(exp_num: int) str#
Given the exp number in the batch, compute a parsable scenario name.
It is necessary to query this criteria after generating the changelist in order to create generator classes for each experiment in the batch with the correct name and definition in some cases.
Normally controller+scenario are used to look up all necessary changes for the specified arena size, but for this criteria the specified scenario is the base scenario (i.e., the starting arena dimensions), and the correct arena dimensions for a given exp must be found via lookup with THIS function).
- gen_attr_changelist() list[sierra.core.experiment.definition.AttrChangeSet][source]#
Generate XML modifications to to maintain constant population density.
Robots are approximated as point masses.
- gen_element_addlist() list[sierra.core.experiment.definition.ElementAddList]#
Generate expdef elelemnts to add to the batch experiment definition.
Modifications are lists, one per experiment in the batch, because the order you apply them matters.
- gen_files() None#
Generate files to add to the batch experiment definition.
Presumably, the created files will be referenced in the
--expdef-templatefile by path.
- gen_tag_rmlist() list[sierra.core.experiment.definition.ElementRmList]#
Generate expdef tags to remove from the batch experiment definition.
Modifications are lists, one per experiment in the batch, because the order you apply them matters.
- graph_info(cmdopts: sierra.core.types.Cmdopts, batch_output_root: pathlib.Path | None = None, exp_names: list[str] | None = None) sierra.core.graphs.bcbridge.GraphInfo[source]#
Generate graph info for generating graphs from Batch Criteria.
- Parameters:
exp_names -- Needed as an optional for bivariate batch criteria. When calculating say yticks using criteria2, if criteria2 uses
populations()in the process, the criteria's OWNgen_exp_names()will be used, which will result in bad directory name calculations. This can be overcome by passing the list of exp names to use at THIS level, which should override the value otherwise present inGraphInfo.
- populations(cmdopts: sierra.core.types.Cmdopts, exp_names: list[str] | None = None) list[int]#
Calculate system sizes used the batch experiment, sorted.
- Parameters:
cmdopts -- Dictionary of parsed command line options.
exp_names -- If is not None, then these directories will be used to calculate the system sizes, rather than the results of
gen_exp_names().
- scaffold_exps(batch_def: sierra.core.experiment.definition.BaseExpDef, cmdopts: sierra.core.types.Cmdopts) None#
Scaffold a batch experiment.
Takes the raw template input file and apply expdef modifications from the batch criteria for all experiments, and save the result in each experiment's input directory.