sierra.core.variables.batch_criteria
Base classes used to define Batch Experiments.
BatchCriteria
: Defines experiments via lists of sets of changes to make to an XML file.IConcreteBatchCriteria
: ‘Final’ interface for user-visible batch criteria.UnivarBatchCriteria
: Base class for a univariate batch criteria.BivarBatchCriteria
: Combination of the definition of two separate batch criteria.
- class sierra.core.variables.batch_criteria.BatchCriteria(cli_arg: str, main_config: Dict[str, Any], batch_input_root: Path)[source]
Defines experiments via lists of sets of changes to make to an XML file.
- cli_arg
Unparsed batch criteria string from command line.
- main_config
Parsed dictionary of main YAML configuration.
- batch_input_root
Absolute path to the directory where batch experiment directories should be created.
Inheritance
- __dict__ = mappingproxy({'__module__': 'sierra.core.variables.batch_criteria', '__doc__': 'Defines experiments via lists of sets of changes to make to an XML file.\n\n Attributes:\n\n cli_arg: Unparsed batch criteria string from command line.\n\n main_config: Parsed dictionary of main YAML configuration.\n\n batch_input_root: Absolute path to the directory where batch experiment\n directories should be created.\n\n ', '__init__': <function BatchCriteria.__init__>, 'gen_attr_changelist': <function BatchCriteria.gen_attr_changelist>, 'gen_tag_rmlist': <function BatchCriteria.gen_tag_rmlist>, 'gen_tag_addlist': <function BatchCriteria.gen_tag_addlist>, 'gen_files': <function BatchCriteria.gen_files>, 'gen_exp_names': <function BatchCriteria.gen_exp_names>, 'arena_dims': <function BatchCriteria.arena_dims>, 'n_exp': <function BatchCriteria.n_exp>, 'pickle_exp_defs': <function BatchCriteria.pickle_exp_defs>, 'scaffold_exps': <function BatchCriteria.scaffold_exps>, '_scaffold_expi': <function BatchCriteria._scaffold_expi>, '__dict__': <attribute '__dict__' of 'BatchCriteria' objects>, '__weakref__': <attribute '__weakref__' of 'BatchCriteria' objects>, '__annotations__': {}})
- __doc__ = 'Defines experiments via lists of sets of changes to make to an XML file.\n\n Attributes:\n\n cli_arg: Unparsed batch criteria string from command line.\n\n main_config: Parsed dictionary of main YAML configuration.\n\n batch_input_root: Absolute path to the directory where batch experiment\n directories should be created.\n\n '
- __module__ = 'sierra.core.variables.batch_criteria'
- __weakref__
list of weak references to the object (if defined)
- _scaffold_expi(expi_def: XMLExpDef, modsi, is_compound: bool, i: int, cmdopts: Dict[str, Any]) None [source]
- arena_dims(cmdopts: Dict[str, Any]) List[ArenaExtent] [source]
Get the arena dimensions used for each experiment in the batch.
Not applicable to all criteria.
Must be implemented on a per-platform basis, as different platforms have different means of computing the size of the arena.
- gen_attr_changelist() List[AttrChangeSet] [source]
- gen_exp_names(cmdopts: Dict[str, Any]) List[str] [source]
Generate list of experiment names from the criteria.
Used for creating unique directory names for each experiment in the batch.
- Returns:
List of experiments names for current experiment.
- gen_tag_addlist() List[TagAddList] [source]
- class sierra.core.variables.batch_criteria.IConcreteBatchCriteria[source]
‘Final’ interface for user-visible batch criteria.
Inheritance
- __doc__ = "\n 'Final' interface for user-visible batch criteria.\n "
- __module__ = 'sierra.core.variables.batch_criteria'
- graph_xlabel(cmdopts: Dict[str, Any]) str [source]
Get the X-label for a graph.
- Returns:
The X-label that should be used for the graphs of various performance measures across batch criteria.
- graph_xticklabels(cmdopts: Dict[str, Any], exp_names: Optional[List[str]] = None) List[str] [source]
Calculate X axis tick labels for graph generation.
- Parameters:
cmdopts – Dictionary of parsed command line options.
exp_names – If not None, then these directories will be used to calculate the labels, rather than the results of gen_exp_names().
- graph_xticks(cmdopts: Dict[str, Any], exp_names: Optional[List[str]] = None) List[float] [source]
Calculate X axis ticks for graph generation.
- Parameters:
cmdopts – Dictionary of parsed command line options.
exp_names – If not None, then this list of directories will be used to calculate the ticks, rather than the results of gen_exp_names().
- class sierra.core.variables.batch_criteria.UnivarBatchCriteria(cli_arg: str, main_config: Dict[str, Any], batch_input_root: Path)[source]
Base class for a univariate batch criteria.
Inheritance
- __doc__ = '\n Base class for a univariate batch criteria.\n '
- __module__ = 'sierra.core.variables.batch_criteria'
- populations(cmdopts: Dict[str, Any], exp_names: Optional[List[str]] = None) List[int] [source]
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()
.
- class sierra.core.variables.batch_criteria.BivarBatchCriteria(criteria1: IConcreteBatchCriteria, criteria2: IConcreteBatchCriteria)[source]
Combination of the definition of two separate batch criteria.
Changed in version 1.2.20: Bivariate batch criteria can be compound: one criteria can create and the other modify XML tags to create an experiment definition.
Inheritance
- __doc__ = '\n Combination of the definition of two separate batch criteria.\n\n .. versionchanged:: 1.2.20\n\n Bivariate batch criteria can be compound: one criteria can create and\n the other modify XML tags to create an experiment definition.\n\n '
- __init__(criteria1: IConcreteBatchCriteria, criteria2: IConcreteBatchCriteria) None [source]
- __module__ = 'sierra.core.variables.batch_criteria'
- exp_scenario_name(exp_num: int) str [source]
Given the expeperiment number, compute a parsable scenario name.
It is necessary to query this function 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.
Can only be called if constant density is one of the sub-criteria.
- gen_attr_changelist() List[AttrChangeSet] [source]
- gen_exp_names(cmdopts: Dict[str, Any]) List[str] [source]
Generate a SORTED list of strings for all experiment names.
These will be used as directory LEAF names–and don’t include the parents.
- gen_tag_addlist() List[TagAddList] [source]
- graph_xticklabels(cmdopts: Dict[str, Any], exp_names: Optional[List[str]] = None) List[str] [source]
- graph_yticklabels(cmdopts: Dict[str, Any], exp_names: Optional[List[str]] = None) List[str] [source]