sierra-research 1.3.6__py3-none-any.whl → 1.5.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sierra/__init__.py +3 -3
- sierra/core/__init__.py +3 -3
- sierra/core/batchroot.py +223 -0
- sierra/core/cmdline.py +681 -1057
- sierra/core/compare.py +11 -0
- sierra/core/config.py +96 -88
- sierra/core/engine.py +306 -0
- sierra/core/execenv.py +380 -0
- sierra/core/expdef.py +11 -0
- sierra/core/experiment/__init__.py +1 -0
- sierra/core/experiment/bindings.py +150 -101
- sierra/core/experiment/definition.py +414 -245
- sierra/core/experiment/spec.py +83 -85
- sierra/core/exproot.py +44 -0
- sierra/core/generators/__init__.py +10 -0
- sierra/core/generators/experiment.py +528 -0
- sierra/core/generators/generator_factory.py +138 -137
- sierra/core/graphs/__init__.py +23 -0
- sierra/core/graphs/bcbridge.py +94 -0
- sierra/core/graphs/heatmap.py +245 -324
- sierra/core/graphs/pathset.py +27 -0
- sierra/core/graphs/schema.py +77 -0
- sierra/core/graphs/stacked_line.py +341 -0
- sierra/core/graphs/summary_line.py +506 -0
- sierra/core/logging.py +3 -2
- sierra/core/models/__init__.py +3 -1
- sierra/core/models/info.py +19 -0
- sierra/core/models/interface.py +52 -122
- sierra/core/pipeline/__init__.py +2 -5
- sierra/core/pipeline/pipeline.py +228 -126
- sierra/core/pipeline/stage1/__init__.py +10 -0
- sierra/core/pipeline/stage1/pipeline_stage1.py +45 -31
- sierra/core/pipeline/stage2/__init__.py +10 -0
- sierra/core/pipeline/stage2/pipeline_stage2.py +8 -11
- sierra/core/pipeline/stage2/runner.py +401 -0
- sierra/core/pipeline/stage3/__init__.py +12 -0
- sierra/core/pipeline/stage3/gather.py +321 -0
- sierra/core/pipeline/stage3/pipeline_stage3.py +37 -84
- sierra/core/pipeline/stage4/__init__.py +12 -2
- sierra/core/pipeline/stage4/pipeline_stage4.py +36 -354
- sierra/core/pipeline/stage5/__init__.py +12 -0
- sierra/core/pipeline/stage5/pipeline_stage5.py +33 -208
- sierra/core/pipeline/yaml.py +48 -0
- sierra/core/plugin.py +529 -62
- sierra/core/proc.py +11 -0
- sierra/core/prod.py +11 -0
- sierra/core/ros1/__init__.py +5 -1
- sierra/core/ros1/callbacks.py +22 -21
- sierra/core/ros1/cmdline.py +59 -88
- sierra/core/ros1/generators.py +159 -175
- sierra/core/ros1/variables/__init__.py +3 -0
- sierra/core/ros1/variables/exp_setup.py +122 -116
- sierra/core/startup.py +106 -76
- sierra/core/stat_kernels.py +4 -5
- sierra/core/storage.py +13 -32
- sierra/core/trampoline.py +30 -0
- sierra/core/types.py +116 -71
- sierra/core/utils.py +103 -106
- sierra/core/variables/__init__.py +1 -1
- sierra/core/variables/base_variable.py +12 -17
- sierra/core/variables/batch_criteria.py +387 -481
- sierra/core/variables/builtin.py +135 -0
- sierra/core/variables/exp_setup.py +19 -39
- sierra/core/variables/population_size.py +72 -76
- sierra/core/variables/variable_density.py +44 -68
- sierra/core/vector.py +1 -1
- sierra/main.py +256 -88
- sierra/plugins/__init__.py +119 -0
- sierra/plugins/compare/__init__.py +14 -0
- sierra/plugins/compare/graphs/__init__.py +19 -0
- sierra/plugins/compare/graphs/cmdline.py +120 -0
- sierra/plugins/compare/graphs/comparator.py +291 -0
- sierra/plugins/compare/graphs/inter_controller.py +531 -0
- sierra/plugins/compare/graphs/inter_scenario.py +297 -0
- sierra/plugins/compare/graphs/namecalc.py +53 -0
- sierra/plugins/compare/graphs/outputroot.py +73 -0
- sierra/plugins/compare/graphs/plugin.py +147 -0
- sierra/plugins/compare/graphs/preprocess.py +172 -0
- sierra/plugins/compare/graphs/schema.py +37 -0
- sierra/plugins/engine/__init__.py +14 -0
- sierra/plugins/engine/argos/__init__.py +18 -0
- sierra/plugins/{platform → engine}/argos/cmdline.py +144 -151
- sierra/plugins/{platform/argos/variables → engine/argos/generators}/__init__.py +5 -0
- sierra/plugins/engine/argos/generators/engine.py +394 -0
- sierra/plugins/engine/argos/plugin.py +393 -0
- sierra/plugins/{platform/argos/generators → engine/argos/variables}/__init__.py +5 -0
- sierra/plugins/engine/argos/variables/arena_shape.py +183 -0
- sierra/plugins/engine/argos/variables/cameras.py +240 -0
- sierra/plugins/engine/argos/variables/constant_density.py +112 -0
- sierra/plugins/engine/argos/variables/exp_setup.py +82 -0
- sierra/plugins/{platform → engine}/argos/variables/physics_engines.py +83 -87
- sierra/plugins/engine/argos/variables/population_constant_density.py +178 -0
- sierra/plugins/engine/argos/variables/population_size.py +115 -0
- sierra/plugins/engine/argos/variables/population_variable_density.py +123 -0
- sierra/plugins/engine/argos/variables/rendering.py +108 -0
- sierra/plugins/engine/ros1gazebo/__init__.py +18 -0
- sierra/plugins/engine/ros1gazebo/cmdline.py +175 -0
- sierra/plugins/{platform/ros1robot → engine/ros1gazebo}/generators/__init__.py +5 -0
- sierra/plugins/engine/ros1gazebo/generators/engine.py +125 -0
- sierra/plugins/engine/ros1gazebo/plugin.py +404 -0
- sierra/plugins/engine/ros1gazebo/variables/__init__.py +15 -0
- sierra/plugins/engine/ros1gazebo/variables/population_size.py +214 -0
- sierra/plugins/engine/ros1robot/__init__.py +18 -0
- sierra/plugins/engine/ros1robot/cmdline.py +159 -0
- sierra/plugins/{platform/ros1gazebo → engine/ros1robot}/generators/__init__.py +4 -0
- sierra/plugins/engine/ros1robot/generators/engine.py +95 -0
- sierra/plugins/engine/ros1robot/plugin.py +410 -0
- sierra/plugins/{hpc/local → engine/ros1robot/variables}/__init__.py +5 -0
- sierra/plugins/engine/ros1robot/variables/population_size.py +146 -0
- sierra/plugins/execenv/__init__.py +11 -0
- sierra/plugins/execenv/hpc/__init__.py +18 -0
- sierra/plugins/execenv/hpc/adhoc/__init__.py +18 -0
- sierra/plugins/execenv/hpc/adhoc/cmdline.py +30 -0
- sierra/plugins/execenv/hpc/adhoc/plugin.py +131 -0
- sierra/plugins/execenv/hpc/cmdline.py +137 -0
- sierra/plugins/execenv/hpc/local/__init__.py +18 -0
- sierra/plugins/execenv/hpc/local/cmdline.py +31 -0
- sierra/plugins/execenv/hpc/local/plugin.py +145 -0
- sierra/plugins/execenv/hpc/pbs/__init__.py +18 -0
- sierra/plugins/execenv/hpc/pbs/cmdline.py +30 -0
- sierra/plugins/execenv/hpc/pbs/plugin.py +121 -0
- sierra/plugins/execenv/hpc/slurm/__init__.py +18 -0
- sierra/plugins/execenv/hpc/slurm/cmdline.py +30 -0
- sierra/plugins/execenv/hpc/slurm/plugin.py +133 -0
- sierra/plugins/execenv/prefectserver/__init__.py +18 -0
- sierra/plugins/execenv/prefectserver/cmdline.py +66 -0
- sierra/plugins/execenv/prefectserver/dockerremote/__init__.py +18 -0
- sierra/plugins/execenv/prefectserver/dockerremote/cmdline.py +66 -0
- sierra/plugins/execenv/prefectserver/dockerremote/plugin.py +132 -0
- sierra/plugins/execenv/prefectserver/flow.py +66 -0
- sierra/plugins/execenv/prefectserver/local/__init__.py +18 -0
- sierra/plugins/execenv/prefectserver/local/cmdline.py +29 -0
- sierra/plugins/execenv/prefectserver/local/plugin.py +133 -0
- sierra/plugins/{hpc/adhoc → execenv/robot}/__init__.py +1 -0
- sierra/plugins/execenv/robot/turtlebot3/__init__.py +18 -0
- sierra/plugins/execenv/robot/turtlebot3/plugin.py +204 -0
- sierra/plugins/expdef/__init__.py +14 -0
- sierra/plugins/expdef/json/__init__.py +14 -0
- sierra/plugins/expdef/json/plugin.py +504 -0
- sierra/plugins/expdef/xml/__init__.py +14 -0
- sierra/plugins/expdef/xml/plugin.py +386 -0
- sierra/{core/hpc → plugins/proc}/__init__.py +1 -1
- sierra/plugins/proc/collate/__init__.py +15 -0
- sierra/plugins/proc/collate/cmdline.py +47 -0
- sierra/plugins/proc/collate/plugin.py +271 -0
- sierra/plugins/proc/compress/__init__.py +18 -0
- sierra/plugins/proc/compress/cmdline.py +47 -0
- sierra/plugins/proc/compress/plugin.py +123 -0
- sierra/plugins/proc/decompress/__init__.py +18 -0
- sierra/plugins/proc/decompress/plugin.py +96 -0
- sierra/plugins/proc/imagize/__init__.py +15 -0
- sierra/plugins/proc/imagize/cmdline.py +49 -0
- sierra/plugins/proc/imagize/plugin.py +270 -0
- sierra/plugins/proc/modelrunner/__init__.py +16 -0
- sierra/plugins/proc/modelrunner/plugin.py +250 -0
- sierra/plugins/proc/statistics/__init__.py +15 -0
- sierra/plugins/proc/statistics/cmdline.py +64 -0
- sierra/plugins/proc/statistics/plugin.py +390 -0
- sierra/plugins/{hpc → prod}/__init__.py +1 -0
- sierra/plugins/prod/graphs/__init__.py +18 -0
- sierra/plugins/prod/graphs/cmdline.py +269 -0
- sierra/plugins/prod/graphs/collate.py +279 -0
- sierra/plugins/prod/graphs/inter/__init__.py +13 -0
- sierra/plugins/prod/graphs/inter/generate.py +83 -0
- sierra/plugins/prod/graphs/inter/heatmap.py +86 -0
- sierra/plugins/prod/graphs/inter/line.py +134 -0
- sierra/plugins/prod/graphs/intra/__init__.py +15 -0
- sierra/plugins/prod/graphs/intra/generate.py +202 -0
- sierra/plugins/prod/graphs/intra/heatmap.py +74 -0
- sierra/plugins/prod/graphs/intra/line.py +114 -0
- sierra/plugins/prod/graphs/plugin.py +103 -0
- sierra/plugins/prod/graphs/targets.py +63 -0
- sierra/plugins/prod/render/__init__.py +18 -0
- sierra/plugins/prod/render/cmdline.py +72 -0
- sierra/plugins/prod/render/plugin.py +282 -0
- sierra/plugins/storage/__init__.py +5 -0
- sierra/plugins/storage/arrow/__init__.py +18 -0
- sierra/plugins/storage/arrow/plugin.py +38 -0
- sierra/plugins/storage/csv/__init__.py +9 -0
- sierra/plugins/storage/csv/plugin.py +12 -5
- sierra/version.py +3 -2
- sierra_research-1.5.0.dist-info/METADATA +238 -0
- sierra_research-1.5.0.dist-info/RECORD +186 -0
- {sierra_research-1.3.6.dist-info → sierra_research-1.5.0.dist-info}/WHEEL +1 -2
- sierra/core/experiment/xml.py +0 -454
- sierra/core/generators/controller_generator_parser.py +0 -34
- sierra/core/generators/exp_creator.py +0 -351
- sierra/core/generators/exp_generators.py +0 -142
- sierra/core/graphs/scatterplot2D.py +0 -109
- sierra/core/graphs/stacked_line_graph.py +0 -249
- sierra/core/graphs/stacked_surface_graph.py +0 -220
- sierra/core/graphs/summary_line_graph.py +0 -369
- sierra/core/hpc/cmdline.py +0 -142
- sierra/core/models/graphs.py +0 -87
- sierra/core/pipeline/stage2/exp_runner.py +0 -286
- sierra/core/pipeline/stage3/imagizer.py +0 -149
- sierra/core/pipeline/stage3/run_collator.py +0 -317
- sierra/core/pipeline/stage3/statistics_calculator.py +0 -478
- sierra/core/pipeline/stage4/graph_collator.py +0 -319
- sierra/core/pipeline/stage4/inter_exp_graph_generator.py +0 -240
- sierra/core/pipeline/stage4/intra_exp_graph_generator.py +0 -317
- sierra/core/pipeline/stage4/model_runner.py +0 -168
- sierra/core/pipeline/stage4/rendering.py +0 -283
- sierra/core/pipeline/stage4/yaml_config_loader.py +0 -103
- sierra/core/pipeline/stage5/inter_scenario_comparator.py +0 -328
- sierra/core/pipeline/stage5/intra_scenario_comparator.py +0 -989
- sierra/core/platform.py +0 -493
- sierra/core/plugin_manager.py +0 -369
- sierra/core/root_dirpath_generator.py +0 -241
- sierra/plugins/hpc/adhoc/plugin.py +0 -125
- sierra/plugins/hpc/local/plugin.py +0 -81
- sierra/plugins/hpc/pbs/__init__.py +0 -9
- sierra/plugins/hpc/pbs/plugin.py +0 -126
- sierra/plugins/hpc/slurm/__init__.py +0 -9
- sierra/plugins/hpc/slurm/plugin.py +0 -130
- sierra/plugins/platform/__init__.py +0 -9
- sierra/plugins/platform/argos/__init__.py +0 -9
- sierra/plugins/platform/argos/generators/platform_generators.py +0 -383
- sierra/plugins/platform/argos/plugin.py +0 -337
- sierra/plugins/platform/argos/variables/arena_shape.py +0 -145
- sierra/plugins/platform/argos/variables/cameras.py +0 -243
- sierra/plugins/platform/argos/variables/constant_density.py +0 -136
- sierra/plugins/platform/argos/variables/exp_setup.py +0 -113
- sierra/plugins/platform/argos/variables/population_constant_density.py +0 -175
- sierra/plugins/platform/argos/variables/population_size.py +0 -102
- sierra/plugins/platform/argos/variables/population_variable_density.py +0 -132
- sierra/plugins/platform/argos/variables/rendering.py +0 -104
- sierra/plugins/platform/ros1gazebo/__init__.py +0 -9
- sierra/plugins/platform/ros1gazebo/cmdline.py +0 -213
- sierra/plugins/platform/ros1gazebo/generators/platform_generators.py +0 -137
- sierra/plugins/platform/ros1gazebo/plugin.py +0 -335
- sierra/plugins/platform/ros1gazebo/variables/__init__.py +0 -10
- sierra/plugins/platform/ros1gazebo/variables/population_size.py +0 -204
- sierra/plugins/platform/ros1robot/__init__.py +0 -9
- sierra/plugins/platform/ros1robot/cmdline.py +0 -175
- sierra/plugins/platform/ros1robot/generators/platform_generators.py +0 -112
- sierra/plugins/platform/ros1robot/plugin.py +0 -373
- sierra/plugins/platform/ros1robot/variables/__init__.py +0 -10
- sierra/plugins/platform/ros1robot/variables/population_size.py +0 -146
- sierra/plugins/robot/__init__.py +0 -9
- sierra/plugins/robot/turtlebot3/__init__.py +0 -9
- sierra/plugins/robot/turtlebot3/plugin.py +0 -194
- sierra_research-1.3.6.data/data/share/man/man1/sierra-cli.1 +0 -2349
- sierra_research-1.3.6.data/data/share/man/man7/sierra-examples.7 +0 -488
- sierra_research-1.3.6.data/data/share/man/man7/sierra-exec-envs.7 +0 -331
- sierra_research-1.3.6.data/data/share/man/man7/sierra-glossary.7 +0 -285
- sierra_research-1.3.6.data/data/share/man/man7/sierra-platforms.7 +0 -358
- sierra_research-1.3.6.data/data/share/man/man7/sierra-usage.7 +0 -725
- sierra_research-1.3.6.data/data/share/man/man7/sierra.7 +0 -78
- sierra_research-1.3.6.dist-info/METADATA +0 -500
- sierra_research-1.3.6.dist-info/RECORD +0 -133
- sierra_research-1.3.6.dist-info/top_level.txt +0 -1
- {sierra_research-1.3.6.dist-info → sierra_research-1.5.0.dist-info}/entry_points.txt +0 -0
- {sierra_research-1.3.6.dist-info → sierra_research-1.5.0.dist-info/licenses}/LICENSE +0 -0
@@ -0,0 +1,172 @@
|
|
1
|
+
#
|
2
|
+
# Copyright 2024 John Harwell, All rights reserved.
|
3
|
+
#
|
4
|
+
# SPDX-License Identifier: MIT
|
5
|
+
#
|
6
|
+
"""Preprocess inter-experiment outputs for stage 5.
|
7
|
+
|
8
|
+
Basically, gather statistics generated from controllers for graph generation in
|
9
|
+
previous stages into the correct files(s) for comparison.
|
10
|
+
"""
|
11
|
+
|
12
|
+
# Core packages
|
13
|
+
import pathlib
|
14
|
+
import typing as tp
|
15
|
+
|
16
|
+
# 3rd party packages
|
17
|
+
import pandas as pd
|
18
|
+
|
19
|
+
# Project packages
|
20
|
+
from sierra.core import utils, config, storage
|
21
|
+
from sierra.core.variables import batch_criteria as bc
|
22
|
+
|
23
|
+
|
24
|
+
class IntraExpPreparer:
|
25
|
+
"""
|
26
|
+
Collate generated stats from previous stages into files(s) for comparison.
|
27
|
+
"""
|
28
|
+
|
29
|
+
def __init__(
|
30
|
+
self,
|
31
|
+
ipath_stem: pathlib.Path,
|
32
|
+
ipath_leaf: str,
|
33
|
+
opath_stem: pathlib.Path,
|
34
|
+
criteria: bc.XVarBatchCriteria,
|
35
|
+
):
|
36
|
+
self.ipath_stem = ipath_stem
|
37
|
+
self.ipath_leaf = ipath_leaf
|
38
|
+
self.opath_stem = opath_stem
|
39
|
+
self.criteria = criteria
|
40
|
+
|
41
|
+
def for_cc(
|
42
|
+
self,
|
43
|
+
controller: str,
|
44
|
+
opath_leaf: str,
|
45
|
+
index: int,
|
46
|
+
inc_exps: tp.Optional[str],
|
47
|
+
) -> None:
|
48
|
+
"""
|
49
|
+
Take batch-level dataframes and creates a new dataframe.
|
50
|
+
|
51
|
+
Has:
|
52
|
+
|
53
|
+
- Experiment names for the index.
|
54
|
+
|
55
|
+
- Controller names as column names (guaranteed to be unique, since
|
56
|
+
that's what we are comparing).
|
57
|
+
|
58
|
+
- df[controller] columns as timeslices *across* columns (i.e., across
|
59
|
+
experiments in the batch) in the source dataframe.
|
60
|
+
"""
|
61
|
+
exts = config.kStats["mean"].exts
|
62
|
+
exts.update(config.kStats["conf95"].exts)
|
63
|
+
exts.update(config.kStats["bw"].exts)
|
64
|
+
|
65
|
+
for k in exts:
|
66
|
+
stat_ipath = pathlib.Path(self.ipath_stem, self.ipath_leaf + exts[k])
|
67
|
+
stat_opath = pathlib.Path(self.opath_stem, opath_leaf + exts[k])
|
68
|
+
df = self._cc_for_stat(stat_ipath, stat_opath, index, inc_exps, controller)
|
69
|
+
|
70
|
+
if df is not None:
|
71
|
+
storage.df_write(
|
72
|
+
df,
|
73
|
+
self.opath_stem / (opath_leaf + exts[k]),
|
74
|
+
"storage.csv",
|
75
|
+
index=True,
|
76
|
+
)
|
77
|
+
|
78
|
+
def for_sc(
|
79
|
+
self,
|
80
|
+
scenario: str,
|
81
|
+
opath_leaf: str,
|
82
|
+
index: int,
|
83
|
+
inc_exps: tp.Optional[str],
|
84
|
+
) -> None:
|
85
|
+
"""
|
86
|
+
Take batch-level dataframes and creates a new dataframe.
|
87
|
+
|
88
|
+
Has:
|
89
|
+
|
90
|
+
- Experiment names for the index.
|
91
|
+
|
92
|
+
- Scenario names as column names (guaranteed to be unique, since
|
93
|
+
that's what we are comparing).
|
94
|
+
|
95
|
+
- df[scenario] columns as timeslices *across* columns (i.e., across
|
96
|
+
experiments in the batch) in the source dataframe.
|
97
|
+
"""
|
98
|
+
exts = config.kStats["mean"].exts
|
99
|
+
exts.update(config.kStats["conf95"].exts)
|
100
|
+
exts.update(config.kStats["bw"].exts)
|
101
|
+
|
102
|
+
for k in exts:
|
103
|
+
stat_ipath = pathlib.Path(self.ipath_stem, self.ipath_leaf + exts[k])
|
104
|
+
stat_opath = pathlib.Path(self.opath_stem, opath_leaf + exts[k])
|
105
|
+
df = self._sc_for_stat(stat_ipath, stat_opath, index, inc_exps, scenario)
|
106
|
+
|
107
|
+
if df is not None:
|
108
|
+
storage.df_write(
|
109
|
+
df,
|
110
|
+
self.opath_stem / (opath_leaf + exts[k]),
|
111
|
+
"storage.csv",
|
112
|
+
index=True,
|
113
|
+
)
|
114
|
+
|
115
|
+
def _cc_for_stat(
|
116
|
+
self,
|
117
|
+
ipath: pathlib.Path,
|
118
|
+
opath: pathlib.Path,
|
119
|
+
index: int,
|
120
|
+
inc_exps: tp.Optional[str],
|
121
|
+
controller: str,
|
122
|
+
) -> pd.DataFrame:
|
123
|
+
|
124
|
+
if utils.path_exists(opath):
|
125
|
+
cum_df = storage.df_read(opath, "storage.csv", index_col="Experiment ID")
|
126
|
+
else:
|
127
|
+
cum_df = pd.DataFrame(index=self.criteria.gen_exp_names())
|
128
|
+
cum_df.index.name = "Experiment ID"
|
129
|
+
|
130
|
+
if utils.path_exists(ipath):
|
131
|
+
df = storage.df_read(ipath, "storage.csv")
|
132
|
+
|
133
|
+
# if inc_exps is not None:
|
134
|
+
# cols = utils.exp_include_filter(
|
135
|
+
# inc_exps, list(df.columns), self.criteria.n_exp()
|
136
|
+
# )
|
137
|
+
|
138
|
+
cum_df[controller] = df.iloc[index]
|
139
|
+
return cum_df
|
140
|
+
|
141
|
+
return None
|
142
|
+
|
143
|
+
def _sc_for_stat(
|
144
|
+
self,
|
145
|
+
ipath: pathlib.Path,
|
146
|
+
opath: pathlib.Path,
|
147
|
+
index: int,
|
148
|
+
inc_exps: tp.Optional[str],
|
149
|
+
scenario: str,
|
150
|
+
) -> pd.DataFrame:
|
151
|
+
if utils.path_exists(opath):
|
152
|
+
cum_df = storage.df_read(opath, "storage.csv", index_col="Experiment ID")
|
153
|
+
else:
|
154
|
+
cum_df = pd.DataFrame(index=self.criteria.gen_exp_names())
|
155
|
+
cum_df.index.name = "Experiment ID"
|
156
|
+
|
157
|
+
if utils.path_exists(ipath):
|
158
|
+
df = storage.df_read(ipath, "storage.csv")
|
159
|
+
|
160
|
+
# if inc_exps is not None:
|
161
|
+
# cols = utils.exp_include_filter(
|
162
|
+
# inc_exps, list(df.columns), self.criteria.n_exp()
|
163
|
+
# )
|
164
|
+
|
165
|
+
cum_df[scenario] = df.iloc[index]
|
166
|
+
|
167
|
+
return cum_df
|
168
|
+
|
169
|
+
return None
|
170
|
+
|
171
|
+
|
172
|
+
__all__ = ["IntraExpPreparer"]
|
@@ -0,0 +1,37 @@
|
|
1
|
+
#
|
2
|
+
# Copyright 2025 John Harwell, All rights reserved.
|
3
|
+
#
|
4
|
+
# SPDX-License Identifier: MIT
|
5
|
+
#
|
6
|
+
"""
|
7
|
+
YAML schemas for comparison graphs for stage 5.
|
8
|
+
|
9
|
+
See :ref:`plugins/compare/graphs` for more details.
|
10
|
+
"""
|
11
|
+
# Core packages
|
12
|
+
|
13
|
+
# 3rd party packages
|
14
|
+
import strictyaml
|
15
|
+
|
16
|
+
# Project packages
|
17
|
+
|
18
|
+
|
19
|
+
cc = strictyaml.Map(
|
20
|
+
{
|
21
|
+
"src_stem": strictyaml.Str(),
|
22
|
+
"dest_stem": strictyaml.Str(),
|
23
|
+
strictyaml.Optional("title"): strictyaml.Str(),
|
24
|
+
strictyaml.Optional("label"): strictyaml.Str(),
|
25
|
+
strictyaml.Optional("primary_axis"): strictyaml.Int(),
|
26
|
+
strictyaml.Optional("include_exp"): strictyaml.Str(),
|
27
|
+
strictyaml.Optional("backend"): strictyaml.Str(),
|
28
|
+
}
|
29
|
+
)
|
30
|
+
"""
|
31
|
+
Schema for controller comparison graphs.
|
32
|
+
"""
|
33
|
+
|
34
|
+
sc = cc
|
35
|
+
"""
|
36
|
+
Schema for scenario comparison graphs.
|
37
|
+
"""
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# Copyright 2021 John Harwell, All rights reserved.
|
2
|
+
#
|
3
|
+
# SPDX-License-Identifier: MIT
|
4
|
+
"""
|
5
|
+
Container module for plugins related to :term:`Engines <Engine>`.
|
6
|
+
|
7
|
+
Driven by ``--engine``.
|
8
|
+
"""
|
9
|
+
|
10
|
+
# Core packages
|
11
|
+
|
12
|
+
# 3rd party packages
|
13
|
+
|
14
|
+
# Project packages
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# Copyright 2021 John Harwell, All rights reserved.
|
2
|
+
#
|
3
|
+
# SPDX-License-Identifier: MIT
|
4
|
+
"""
|
5
|
+
Container module for the term:`ARGoS` engine.
|
6
|
+
|
7
|
+
See :ref:`plugins/engine/argos`.
|
8
|
+
"""
|
9
|
+
|
10
|
+
# Core packages
|
11
|
+
|
12
|
+
# 3rd party packages
|
13
|
+
|
14
|
+
# Project packages
|
15
|
+
|
16
|
+
|
17
|
+
def sierra_plugin_type() -> str:
|
18
|
+
return "pipeline"
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# SPDX-License-Identifier: MIT
|
4
4
|
#
|
5
5
|
"""
|
6
|
-
Command line
|
6
|
+
Command line definitions for the :term:`ARGoS` :term:`Engine`.
|
7
7
|
"""
|
8
8
|
|
9
9
|
# Core packages
|
@@ -13,68 +13,43 @@ import argparse
|
|
13
13
|
# 3rd party packages
|
14
14
|
|
15
15
|
# Project packages
|
16
|
-
from sierra.core import types, config
|
17
|
-
|
16
|
+
from sierra.core import types, config
|
17
|
+
from sierra.plugins import PluginCmdline
|
18
18
|
|
19
19
|
|
20
|
-
class
|
21
|
-
"""Defines :term:`ARGoS`
|
20
|
+
class EngineCmdline(PluginCmdline):
|
21
|
+
"""Defines :term:`ARGoS` cmdline."""
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
if parents is not None:
|
30
|
-
self.parser = argparse.ArgumentParser(add_help=False,
|
31
|
-
parents=parents,
|
32
|
-
allow_abbrev=False)
|
33
|
-
else:
|
34
|
-
self.parser = argparse.ArgumentParser(add_help=False,
|
35
|
-
allow_abbrev=False)
|
36
|
-
|
37
|
-
self.scaffold_cli()
|
38
|
-
self.init_cli(stages)
|
39
|
-
|
40
|
-
def scaffold_cli(self) -> None:
|
41
|
-
self.stage1_exp = self.parser.add_argument_group(
|
42
|
-
'Stage1: Experiment generation')
|
43
|
-
self.stage1_physics = self.parser.add_argument_group(
|
44
|
-
'Stage1: Configuring ARGoS physics engines')
|
45
|
-
self.stage1_rendering = self.parser.add_argument_group(
|
46
|
-
'Stage1: Rendering (see also stage4 rendering options)')
|
47
|
-
self.stage1_robots = self.parser.add_argument_group(
|
48
|
-
'Stage1: Configuring robots')
|
49
|
-
|
50
|
-
def init_cli(self, stages: tp.List[int]) -> None:
|
51
|
-
if 1 in stages:
|
52
|
-
self.init_stage1()
|
23
|
+
def __init__(
|
24
|
+
self,
|
25
|
+
parents: tp.List[argparse.ArgumentParser],
|
26
|
+
stages: tp.List[int],
|
27
|
+
) -> None:
|
28
|
+
super().__init__(parents, stages)
|
53
29
|
|
54
30
|
def init_stage1(self) -> None:
|
55
31
|
# Experiment options
|
56
32
|
|
57
|
-
self.
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
config.kARGoS['n_ticks_per_sec'],
|
71
|
-
config.kExperimentalRunData['n_datapoints_1D']))
|
33
|
+
self.stage1.add_argument(
|
34
|
+
"--exp-setup",
|
35
|
+
help="""
|
36
|
+
Defines experiment run length, :term:`Ticks <Tick>` per second
|
37
|
+
for the experiment (<experiment> tag). See
|
38
|
+
:ref:`usage/vars/expsetup` for a full description.
|
39
|
+
"""
|
40
|
+
+ self.stage_usage_doc([1]),
|
41
|
+
default="exp_setup.T{0}.K{1}".format(
|
42
|
+
config.kARGoS["n_secs_per_run"],
|
43
|
+
config.kARGoS["n_ticks_per_sec"],
|
44
|
+
),
|
45
|
+
)
|
72
46
|
|
73
47
|
# Physics engines options
|
74
48
|
|
75
|
-
self.
|
76
|
-
|
77
|
-
|
49
|
+
self.stage1.add_argument(
|
50
|
+
"--physics-engine-type2D",
|
51
|
+
choices=["dynamics2d"],
|
52
|
+
help="""
|
78
53
|
|
79
54
|
The type of 2D physics engine to use
|
80
55
|
for managing spatial extents within the
|
@@ -84,12 +59,15 @@ class PlatformCmdline(cmd.BaseCmdline):
|
|
84
59
|
controlled by 2D physics engines is
|
85
60
|
defined on a per ``--project`` basis.
|
86
61
|
|
87
|
-
"""
|
88
|
-
|
62
|
+
"""
|
63
|
+
+ self.stage_usage_doc([1]),
|
64
|
+
default="dynamics2d",
|
65
|
+
)
|
89
66
|
|
90
|
-
self.
|
91
|
-
|
92
|
-
|
67
|
+
self.stage1.add_argument(
|
68
|
+
"--physics-engine-type3D",
|
69
|
+
choices=["dynamics3d"],
|
70
|
+
help="""
|
93
71
|
|
94
72
|
The type of 3D physics engine to use
|
95
73
|
for managing 3D volumetric extents
|
@@ -100,13 +78,16 @@ class PlatformCmdline(cmd.BaseCmdline):
|
|
100
78
|
engines is defined on a per
|
101
79
|
``--project`` basis.
|
102
80
|
|
103
|
-
"""
|
104
|
-
|
81
|
+
"""
|
82
|
+
+ self.stage_usage_doc([1]),
|
83
|
+
default="dynamics3d",
|
84
|
+
)
|
105
85
|
|
106
|
-
self.
|
107
|
-
|
108
|
-
|
109
|
-
|
86
|
+
self.stage1.add_argument(
|
87
|
+
"--physics-n-engines",
|
88
|
+
choices=[1, 2, 4, 6, 8, 12, 16, 24],
|
89
|
+
type=int,
|
90
|
+
help="""
|
110
91
|
|
111
92
|
# of physics engines to use during
|
112
93
|
simulation (yay ARGoS!). If N > 1, the
|
@@ -130,7 +111,7 @@ class PlatformCmdline(cmd.BaseCmdline):
|
|
130
111
|
the arena, and 2 3D engines will manage
|
131
112
|
the other 2/3 of the arena.
|
132
113
|
|
133
|
-
If ``--
|
114
|
+
If ``--execenv`` is something other
|
134
115
|
than ``hpc.local`` then the # physics
|
135
116
|
engines will be computed from the HPC
|
136
117
|
environment, and the cmdline value (if
|
@@ -158,10 +139,13 @@ class PlatformCmdline(cmd.BaseCmdline):
|
|
158
139
|
|
159
140
|
This is enforced by SIERRA.
|
160
141
|
|
161
|
-
"""
|
162
|
-
|
163
|
-
|
164
|
-
|
142
|
+
"""
|
143
|
+
+ self.stage_usage_doc([1]),
|
144
|
+
)
|
145
|
+
self.stage1.add_argument(
|
146
|
+
"--physics-iter-per-tick",
|
147
|
+
type=int,
|
148
|
+
help="""
|
165
149
|
|
166
150
|
The # of iterations all physics engines
|
167
151
|
should perform per :term:`Tick` each
|
@@ -170,29 +154,32 @@ class PlatformCmdline(cmd.BaseCmdline):
|
|
170
154
|
control loops is set via
|
171
155
|
``--exp-setup``).
|
172
156
|
|
173
|
-
"""
|
174
|
-
|
157
|
+
"""
|
158
|
+
+ self.stage_usage_doc([1]),
|
159
|
+
default=config.kARGoS["physics_iter_per_tick"],
|
160
|
+
)
|
175
161
|
|
176
|
-
self.
|
177
|
-
|
162
|
+
self.stage1.add_argument(
|
163
|
+
"--physics-spatial-hash2D",
|
164
|
+
help="""
|
178
165
|
|
179
166
|
Specify that each 2D physics engine
|
180
167
|
should use a spatial hash (only applies
|
181
168
|
to ``dynamics2d`` engine type).
|
182
169
|
|
183
170
|
""",
|
184
|
-
|
171
|
+
action="store_true",
|
172
|
+
)
|
185
173
|
|
186
174
|
# Rendering options
|
187
|
-
self.
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
help="""
|
175
|
+
self.stage1.add_argument(
|
176
|
+
"--camera-config",
|
177
|
+
choices=["overhead", "sw", "sw+interp"],
|
178
|
+
help="""
|
192
179
|
|
193
180
|
Select the camera configuration for
|
194
181
|
simulation. Ignored unless
|
195
|
-
``--
|
182
|
+
``--engine-vc`` is passed. Valid
|
196
183
|
values are:
|
197
184
|
|
198
185
|
- ``overhead`` - Use a single
|
@@ -210,16 +197,19 @@ class PlatformCmdline(cmd.BaseCmdline):
|
|
210
197
|
- ``sw+interp`` - Same as ``sw``, but
|
211
198
|
with interpolation between cameras.
|
212
199
|
|
213
|
-
"""
|
214
|
-
|
200
|
+
"""
|
201
|
+
+ self.stage_usage_doc([1]),
|
202
|
+
default="overhead",
|
203
|
+
)
|
215
204
|
|
216
|
-
self.
|
217
|
-
|
205
|
+
self.stage1.add_argument(
|
206
|
+
"--with-robot-rab",
|
207
|
+
help="""
|
218
208
|
|
219
209
|
If passed, do not remove the Range and
|
220
210
|
Bearing (RAB) sensor, actuator, and
|
221
211
|
medium XML definitions from
|
222
|
-
``--template
|
212
|
+
``--expdef-template`` before
|
223
213
|
generating experimental
|
224
214
|
inputs. Otherwise, the following XML
|
225
215
|
tags are removed if they exist:
|
@@ -228,16 +218,19 @@ class PlatformCmdline(cmd.BaseCmdline):
|
|
228
218
|
- ``.//actuators/range_and_bearing``
|
229
219
|
- ``.//sensors/range_and_bearing``
|
230
220
|
|
231
|
-
"""
|
232
|
-
|
233
|
-
|
221
|
+
"""
|
222
|
+
+ self.stage_usage_doc([1]),
|
223
|
+
action="store_true",
|
224
|
+
default=False,
|
225
|
+
)
|
234
226
|
|
235
|
-
self.
|
236
|
-
|
227
|
+
self.stage1.add_argument(
|
228
|
+
"--with-robot-leds",
|
229
|
+
help="""
|
237
230
|
|
238
231
|
If passed, do not remove the robot LED
|
239
232
|
actuator XML definitions from the
|
240
|
-
``--template
|
233
|
+
``--expdef-template`` before
|
241
234
|
generating experimental
|
242
235
|
inputs. Otherwise, the following XML
|
243
236
|
tags are removed if they exist:
|
@@ -246,16 +239,19 @@ class PlatformCmdline(cmd.BaseCmdline):
|
|
246
239
|
- ``.//medium/leds``
|
247
240
|
- ``.//sensors/colored_blob_omnidirectional_camera``
|
248
241
|
|
249
|
-
"""
|
250
|
-
|
251
|
-
|
242
|
+
"""
|
243
|
+
+ self.stage_usage_doc([1]),
|
244
|
+
action="store_true",
|
245
|
+
default=False,
|
246
|
+
)
|
252
247
|
|
253
|
-
self.
|
254
|
-
|
248
|
+
self.stage1.add_argument(
|
249
|
+
"--with-robot-battery",
|
250
|
+
help="""
|
255
251
|
|
256
252
|
If passed, do not remove the robot
|
257
253
|
battery sensor XML definitions from
|
258
|
-
``--template
|
254
|
+
``--expdef-template`` before
|
259
255
|
generating experimental
|
260
256
|
inputs. Otherwise, the following XML
|
261
257
|
tags are removed if they exist:
|
@@ -263,63 +259,60 @@ class PlatformCmdline(cmd.BaseCmdline):
|
|
263
259
|
- ``.//entity/*/battery``
|
264
260
|
- ``.//sensors/battery``
|
265
261
|
|
266
|
-
"""
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
class CmdlineValidator(cmd.CoreCmdlineValidator):
|
316
|
-
pass
|
262
|
+
"""
|
263
|
+
+ self.stage_usage_doc([1]),
|
264
|
+
action="store_true",
|
265
|
+
default=False,
|
266
|
+
)
|
267
|
+
|
268
|
+
self.stage1.add_argument(
|
269
|
+
"--n-agents",
|
270
|
+
help="""
|
271
|
+
The # agents (robots) that should
|
272
|
+
be used in the simulation. Can be
|
273
|
+
used to override batch criteria, or
|
274
|
+
to supplement experiments that do
|
275
|
+
not set it so that manual
|
276
|
+
modification of input file is
|
277
|
+
unneccesary.
|
278
|
+
"""
|
279
|
+
+ self.stage_usage_doc([1]),
|
280
|
+
type=int,
|
281
|
+
default=None,
|
282
|
+
)
|
283
|
+
|
284
|
+
|
285
|
+
def build(
|
286
|
+
parents: tp.List[argparse.ArgumentParser], stages: tp.List[int]
|
287
|
+
) -> PluginCmdline:
|
288
|
+
"""
|
289
|
+
Get a cmdline parser supporting the :term:`ARGoS` engine.
|
290
|
+
"""
|
291
|
+
return EngineCmdline(parents=parents, stages=stages)
|
292
|
+
|
293
|
+
|
294
|
+
def to_cmdopts(args: argparse.Namespace) -> types.Cmdopts:
|
295
|
+
"""Update cmdopts with ARGoS-specific cmdline options."""
|
296
|
+
return {
|
297
|
+
# Stage 1
|
298
|
+
"n_agents": args.n_agents,
|
299
|
+
"exp_setup": args.exp_setup,
|
300
|
+
"physics_n_engines": args.physics_n_engines,
|
301
|
+
"physics_n_threads": args.physics_n_engines, # alias
|
302
|
+
"physics_engine_type2D": args.physics_engine_type2D,
|
303
|
+
"physics_engine_type3D": args.physics_engine_type3D,
|
304
|
+
"physics_iter_per_tick": args.physics_iter_per_tick,
|
305
|
+
"physics_spatial_hash2D": args.physics_spatial_hash2D,
|
306
|
+
"with_robot_rab": args.with_robot_rab,
|
307
|
+
"with_robot_leds": args.with_robot_leds,
|
308
|
+
"with_robot_battery": args.with_robot_battery,
|
309
|
+
"camera_config": args.camera_config,
|
310
|
+
}
|
317
311
|
|
318
312
|
|
319
313
|
def sphinx_cmdline_stage1():
|
320
|
-
return
|
314
|
+
return EngineCmdline([], [1]).parser
|
321
315
|
|
322
316
|
|
323
317
|
def sphinx_cmdline_stage2():
|
324
|
-
|
325
|
-
return PlatformCmdline([parent], [2]).parser
|
318
|
+
return EngineCmdline([], [2]).parser
|