Add command-line arguments for data collection options
This commit is contained in:
parent
0ce010a12d
commit
b442fbc0f2
@ -24,9 +24,9 @@ class OutputConfig:
|
|||||||
enabled: bool = True
|
enabled: bool = True
|
||||||
directory: str = "simulation_output"
|
directory: str = "simulation_output"
|
||||||
formats: List[str] = field(default_factory=lambda: ['json'])
|
formats: List[str] = field(default_factory=lambda: ['json'])
|
||||||
collect_metrics: bool = True
|
collect_metrics: bool = False
|
||||||
collect_entities: bool = True
|
collect_entities: bool = False
|
||||||
collect_evolution: bool = True
|
collect_evolution: bool = False
|
||||||
metrics_interval: int = 100
|
metrics_interval: int = 100
|
||||||
entities_interval: int = 1000
|
entities_interval: int = 1000
|
||||||
evolution_interval: int = 1000
|
evolution_interval: int = 1000
|
||||||
|
|||||||
@ -51,6 +51,26 @@ def main():
|
|||||||
action="store_true",
|
action="store_true",
|
||||||
help="Run in real-time mode (instead of as fast as possible)"
|
help="Run in real-time mode (instead of as fast as possible)"
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--collect-metrics",
|
||||||
|
action="store_true",
|
||||||
|
help="Enable metrics data collection"
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--collect-entities",
|
||||||
|
action="store_true",
|
||||||
|
help="Enable entity data collection"
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--collect-evolution",
|
||||||
|
action="store_true",
|
||||||
|
help="Enable evolution data collection"
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--collect-all",
|
||||||
|
action="store_true",
|
||||||
|
help="Enable all data collection (metrics, entities, evolution)"
|
||||||
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--collect-every-tick",
|
"--collect-every-tick",
|
||||||
action="store_true",
|
action="store_true",
|
||||||
@ -90,11 +110,35 @@ def main():
|
|||||||
headless_config.output.directory = args.output_dir
|
headless_config.output.directory = args.output_dir
|
||||||
if args.real_time:
|
if args.real_time:
|
||||||
headless_config.output.real_time = True
|
headless_config.output.real_time = True
|
||||||
|
# Handle data collection arguments - only enable if explicitly requested
|
||||||
|
# Start with all disabled (default)
|
||||||
|
headless_config.output.collect_metrics = False
|
||||||
|
headless_config.output.collect_entities = False
|
||||||
|
headless_config.output.collect_evolution = False
|
||||||
|
|
||||||
|
if args.collect_all:
|
||||||
|
# Enable all collection
|
||||||
|
headless_config.output.collect_metrics = True
|
||||||
|
headless_config.output.collect_entities = True
|
||||||
|
headless_config.output.collect_evolution = True
|
||||||
|
else:
|
||||||
|
# Enable specific collection types
|
||||||
|
if args.collect_metrics:
|
||||||
|
headless_config.output.collect_metrics = True
|
||||||
|
if args.collect_entities:
|
||||||
|
headless_config.output.collect_entities = True
|
||||||
|
if args.collect_evolution:
|
||||||
|
headless_config.output.collect_evolution = True
|
||||||
|
|
||||||
if args.collect_every_tick:
|
if args.collect_every_tick:
|
||||||
# Set all collection intervals to 1 for every-tick collection
|
# Set all collection intervals to 1 for every-tick collection
|
||||||
headless_config.output.metrics_interval = 1
|
headless_config.output.metrics_interval = 1
|
||||||
headless_config.output.entities_interval = 1
|
headless_config.output.entities_interval = 1
|
||||||
headless_config.output.evolution_interval = 1
|
headless_config.output.evolution_interval = 1
|
||||||
|
# Also enable all collection if using --collect-every-tick (backward compatibility)
|
||||||
|
headless_config.output.collect_metrics = True
|
||||||
|
headless_config.output.collect_entities = True
|
||||||
|
headless_config.output.collect_evolution = True
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Error loading configuration: {e}")
|
print(f"Error loading configuration: {e}")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user