Imported from ActiveInferenceInstitute/ActiveInferAnts (
2_OPERATE/AGENTS.md). Install upstream withnpx skills add ActiveInferenceInstitute/ActiveInferAnts --skill 2_OPERATE. Copyright stays with the author.
AGENTS.md — Runtime Execution
Agent guidance for the
2_OPERATEdirectory within the Active InferAnts framework.
Purpose
Runtime execution, simulation management, and cognitive utilities. This phase orchestrates the execution of Active Inference simulations and agent behaviors.
Directory Contents
Pipeline Modules
- 📄
plan_Simulation.py—SimulationPlannerclass (aliasSimulationSetup): simulation planning — environment setup, agent initialization, and parameter configuration (reads1_PREPARE/configs) - 📄
execute_Simulation.py—SimulationExecutorclass: time-stepped simulation loop with visualization frequency and sleep duration controls - 📄
render_Simulation.py—SimulationRendererclass: matplotlib-based animation,Entityrendering, and real-time visualization - 📄
environment.py—Environmentclass: 2D grid world with pheromone field, food sources, and nests;build_environment_from_confighelper - 📄
MetaInformAnt_Simulation.py—MetaInformAntSimulationclass: drivesactive_infer_antsagents through the grid environment (progress, aggregate results, visualization parameters)
Observability & Support
- 📄
data_logging.py—DataLoggerclass: per-step records and JSON result persistence - 📄
performance_monitor.py—PerformanceMonitorclass: runtime timing and parameter-adjustment checkpoints - 📄
performance_metrics.py—PerformanceTrackerclass: scalar metrics and cross-run aggregates - 📄
error_handling.py—SimulationErrorexception +handle_simulation_errorre-raise helper - 📄
exception_handling.py—SimulationExceptionHandlerclass: fail-closed error payloads - 📄
report_generator.py—ReportGeneratorclass: plain-text simulation reports - 📄
computational_resources.py—estimate_computational_resourcesadvisory cost estimate - 📄
visualization.py—SimulationVisualizerclass: summary and comparative plots
Analysis
- 📄
cognitive_utilities.py—CognitiveUtilitiesclass: agent behavioral analysis, cognitive load assessment, decision support, and multi-format export (JSON/CSV/Excel via pandas) - 📄
situational_Antwareness.py—AgentVisualizerabstract base class +ConcreteAgentVisualizer: A/B/C/D/G/F matrix visualization, eigenvalue analysis, seaborn heatmaps, and agent state evolution tracking
Agent Instructions
- Maintain simulation execution pipeline:
plan_Simulation.py→execute_Simulation.py→render_Simulation.py. - The pipeline is wired to the
active_infer_antspackage for the agent-side API; keep the wiring and the integration suite (tests/test_simulation_pipeline.py) in sync. - Ensure
CognitiveUtilitiesexport methods (JSON/CSV/Excel) produce valid output. - Preserve the
AgentVisualizerABC hierarchy andConcreteAgentVisualizerintegration with the simulation context. - The optional per-agent visualizer requires matrix attributes (
A_matrix,B_matrix, …) thatactive_infer_antsagents do not carry; keep that call path guarded and non-fatal. - Track pipeline inputs from
1_PREPAREagent definitions and outputs consumed by3_MEASURE. - Follow the repository's CC BY-NC-ND 4.0 license.
- Keep all documentation synchronized with actual contents.
Quality Checklist
- All files documented and up-to-date
- Pipeline flow (plan → execute → render) verified
- Integration suite covers the pipeline end-to-end
- README.md and SPEC.md synchronized with this AGENTS.md