You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds a dependency-free pure-Python simulator for the market game, plus focused checks that validate rule behavior and parity with the stock example houses.
This does not change the HELICS runtime path. The existing market_maker.py, battery.py, and house federates continue to run the official co-simulation. The new simulator provides a fast local path for checking market-game rules, battery constraints, invalid-demand penalties, and expected strategy outcomes without starting HELICS federates.
What Changed
Added python/market_game/simulation/
config.py: market-game constants and demand profiles
rules.py: price calculation, battery clamping, and validation helpers
This is one step towards a series of potential PRs that would range from increased testing up to teams able to train small reinforcement learning (RL) models for the CTF competition. Below is a potential set of incremental PRs.
PR: Baseline Evaluator
Add a small command that runs built-in strategies through the simulator and prints/exports results.
reject obvious unsafe imports/side effects if needed
run 24-hour smoke simulation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a dependency-free pure-Python simulator for the market game, plus focused checks that validate rule behavior and parity with the stock example houses.
This does not change the HELICS runtime path. The existing
market_maker.py,battery.py, and house federates continue to run the official co-simulation. The new simulator provides a fast local path for checking market-game rules, battery constraints, invalid-demand penalties, and expected strategy outcomes without starting HELICS federates.What Changed
python/market_game/simulation/config.py: market-game constants and demand profilesrules.py: price calculation, battery clamping, and validation helperssimulator.py: 24-hour pure-Python episode runnerpython/market_game/docs/simulation.mdpython/market_game/simulation/README.mdpython/market_game/tests/check_simulation.pypython/market_game/tests/check_simulation_core.pypython/market_game/tests/check_simulation_parity.pypython/market_game/market_game.mdto mention the simulator checks and docs.Parity Coverage
The parity check verifies the expected 24-hour totals for the stock example houses:
FlattenDemandHouse127.0$35.44677.0FullCycleHouse120.0$47.74670.0PriceAwareHouse125.0$21.95335.0Validation
Tested with: