How maheshks74/ecotwin_ai works
EcoTwin’s main workflow is an operator using the dashboard to inspect plant telemetry and compare or direct energy-aware production. The Gymnasium environment combines tariffs, weather, and scenarios with a simulated factory; controllers choose machine and HVAC actions, and evaluation summarizes cost, peak demand, and quota outcomes. Separate branches provide preference-based reward learning and an LLM advisor/directive compiler. The README documents these capabilities; some dashboard and evaluation connections below are documented rather than verified from implementation excerpts.
Main entry points: run_eval.py Benchmark runner · ecotwin_env.py Gymnasium environment · app.py Streamlit dashboard · factory.py Factory floor simulator
Components 24
Operational Inputs
- Tariff manager
ecotwin/data/tariff.py - Weather manager
ecotwin/data/weather.py - Scenario manager
ecotwin/data/scenarios.py
Plant Simulation
- Factory floor simulator
ecotwin/twin/factory.py - Production machines
ecotwin/twin/machines.py - HVAC thermal zones
ecotwin/twin/hvac.py - Job queue
ecotwin/twin/jobs.py
Control and Learning
- Gymnasium environment
ecotwin/env/ecotwin_env.py - Fixed controller
ecotwin/controllers/fixed.py - Rule-based controller
ecotwin/controllers/rule_based.py - Hand-reward PPO
ecotwin/controllers/ppo_train.py - Preference PPO
ecotwin/controllers/ppo_pref.py - Simulated manager
ecotwin/preference/simulated_manager.py - Trajectory pair generator
ecotwin/preference/pair_generator.py - Preference reward model
ecotwin/preference/reward_model.py
Evaluation and Advice
- Benchmark runner
ecotwin/evaluation/run_eval.py - Evaluation metrics
ecotwin/evaluation/metrics.py - Evaluation plots
ecotwin/evaluation/plots.py - Telemetry logger
ecotwin/llm/logger.py - LLM operations advisor
ecotwin/llm/advisor.py - Directive parser
ecotwin/llm/instruction_parser.py - Gemini client
ecotwin/llm/client.py
Operator Interface
- Streamlit dashboard
dashboard/app.py
Other components
- Plant operator
Connections 35
- Plant operator → Streamlit dashboard: uses
README.md - Streamlit dashboard → Gymnasium environment: runs simulations
README.md - Streamlit dashboard → Benchmark runner: shows benchmarks
README.md - Streamlit dashboard → LLM operations advisor: offers Q&A
README.md - Streamlit dashboard → Directive parser: compiles directives
README.md - Gymnasium environment → Factory floor simulator: advances simulation
ecotwin/env/ecotwin_env.py - Gymnasium environment → Tariff manager: reads prices
ecotwin/env/ecotwin_env.py - Gymnasium environment → Weather manager: reads forecasts
ecotwin/env/ecotwin_env.py - Gymnasium environment → Scenario manager: builds scenario
ecotwin/env/ecotwin_env.py - Gymnasium environment → Fixed controller: accepts actions from
README.md - Gymnasium environment → Rule-based controller: accepts actions from
README.md - Gymnasium environment → Hand-reward PPO: trains policy on
ecotwin/controllers/ppo_train.py - Factory floor simulator → Production machines: builds
ecotwin/twin/factory.py - Factory floor simulator → HVAC thermal zones: builds
ecotwin/twin/factory.py - Factory floor simulator → Job queue: creates queue
ecotwin/twin/factory.py - Scenario manager → Job queue: adds scenario jobs
ecotwin/data/scenarios.py - Benchmark runner → Gymnasium environment: runs episodes
ecotwin/evaluation/run_eval.py - Benchmark runner → Fixed controller: benchmarks
ecotwin/evaluation/run_eval.py - Benchmark runner → Rule-based controller: benchmarks
ecotwin/evaluation/run_eval.py - Benchmark runner → Hand-reward PPO: benchmarks
ecotwin/evaluation/run_eval.py - Benchmark runner → Preference PPO: benchmarks
ecotwin/evaluation/run_eval.py - Benchmark runner → Simulated manager: creates preferences
ecotwin/evaluation/run_eval.py - Benchmark runner → Trajectory pair generator: generates comparisons
ecotwin/evaluation/run_eval.py - Benchmark runner → Preference reward model: trains model
ecotwin/evaluation/run_eval.py - Benchmark runner → Evaluation metrics: summarizes results
README.md - Benchmark runner → Evaluation plots: generates figures
README.md - Benchmark runner → Telemetry logger: logs telemetry
ecotwin/evaluation/run_eval.py - Trajectory pair generator → Simulated manager: compares trajectories
ecotwin/preference/pair_generator.py - Preference reward model → Simulated manager: uses trajectory type
ecotwin/preference/reward_model.py - Preference PPO → Preference reward model: uses learned reward
README.md - Telemetry logger → Factory floor simulator: reads floor state
ecotwin/llm/logger.py - LLM operations advisor → Gemini client: requests responses
ecotwin/llm/advisor.py - Directive parser → Gemini client: requests parsing
ecotwin/llm/instruction_parser.py - LLM operations advisor → Telemetry logger: grounds answers in telemetry
README.md - Streamlit dashboard → Telemetry logger: replays telemetry
README.md