sierra.plugins.engine.argos.variables.population_variable_density#

Classes for the variable population density batch criteria.

See Population Variable Density for usage documentation.

Classes#

PopulationVariableDensity

Defines XML changes for variable population density within a single arena.

Module Contents#

class sierra.plugins.engine.argos.variables.population_variable_density.PopulationVariableDensity(*args, **kwargs)[source]#
Inheritance diagram of sierra.plugins.engine.argos.variables.population_variable_density.PopulationVariableDensity

Defines XML changes for variable population density within a single arena.

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 ranges.

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.

gen_attr_changelist() list[sierra.core.experiment.definition.AttrChangeSet][source]#

Generate XML modifications to achieve the desired population densities.

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-template file 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 OWN gen_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 in GraphInfo.

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.