diff --git a/gsy_framework/constants_limits.py b/gsy_framework/constants_limits.py index 60ab9810..335e4e2e 100644 --- a/gsy_framework/constants_limits.py +++ b/gsy_framework/constants_limits.py @@ -257,6 +257,7 @@ class BalancingSettings: class SCMSettings: """Default settings for the community manager.""" GRID_FEES_REDUCTION = 0.28 + INTRACOMMUNITY_BASE_RATE_EUR = None MARKET_ALGORITHM = CoefficientAlgorithm.STATIC.value MARKET_ALGORITHM_LIMIT = RangeLimit(1, 3) diff --git a/gsy_framework/enums.py b/gsy_framework/enums.py index b2c445c7..8eb5de60 100644 --- a/gsy_framework/enums.py +++ b/gsy_framework/enums.py @@ -25,6 +25,7 @@ class CoefficientAlgorithm(Enum): STATIC = 1 DYNAMIC = 2 NO_COMMUNITY_SELF_CONSUMPTION = 3 + LIVE_STREAM = 4 class CloudCoverage(Enum): diff --git a/gsy_framework/schema/avro_schemas/launch_simulation_settings.json b/gsy_framework/schema/avro_schemas/launch_simulation_settings.json index 5c77efff..decd967c 100644 --- a/gsy_framework/schema/avro_schemas/launch_simulation_settings.json +++ b/gsy_framework/schema/avro_schemas/launch_simulation_settings.json @@ -25,7 +25,11 @@ {"name": "settlement_market_enabled", "type": "boolean"}, {"name": "relative_std_from_forecast_percent", "type": "float"}, {"name": "bid_offer_match_algo", "type": "int"}, - {"name": "scm_coefficient_algorithm", "type": "int"}, - {"name": "type", "type": ["null","int"], "default": "undefined"} + {"name": "type", "type": ["null","int"], "default": "undefined"}, + {"name": "scm_coefficient_algorithm", "type": ["null", "int"], "default": "null"}, + {"name": "scm", "type": [ + "null", + {"type": "map", "values" : ["float", "int", "string", "null"], "default": {}} + ]} ] } diff --git a/gsy_framework/schema/avro_schemas/simulation_state.json b/gsy_framework/schema/avro_schemas/simulation_state.json index 6db429f2..b39ab695 100644 --- a/gsy_framework/schema/avro_schemas/simulation_state.json +++ b/gsy_framework/schema/avro_schemas/simulation_state.json @@ -278,13 +278,6 @@ "name": "used_storage", "type": "float" }, - { - "name": "used_history", - "type": { - "type": "map", - "values": "string" - } - }, { "name": "charge_history", "type": { @@ -303,7 +296,7 @@ "name": "offered_history", "type": { "type": "map", - "values": "float" + "values": ["string", "float"] } }, { diff --git a/gsy_framework/schemas.py b/gsy_framework/schemas.py index 7eb7873d..fbc5f25b 100644 --- a/gsy_framework/schemas.py +++ b/gsy_framework/schemas.py @@ -418,8 +418,12 @@ class ApiClientConfigSchema: "type": "string", "enum": ["constant", "dynamic"] }, + "group_settings": { + "type": "string", + "enum": ["constant", "dynamic"] + }, }, - "required": ["start_date", "end_date", "slot_length", "currency", "coefficient_type"] + "required": ["start_date", "end_date", "slot_length", "currency"] }, "grid": {"type": ["object"]} } diff --git a/gsy_framework/sim_results/scm/bills.py b/gsy_framework/sim_results/scm/bills.py index d2d5c362..a3ab74bb 100644 --- a/gsy_framework/sim_results/scm/bills.py +++ b/gsy_framework/sim_results/scm/bills.py @@ -31,6 +31,7 @@ def _empty_bills_dict() -> Dict: "sold_to_grid": 0., "sold_to_community": 0., "earned_from_grid": 0., + "earned_from_community": 0., "home_balance_kWh": 0., "home_balance": 0., "base_energy_bill_excl_revenue": 0., diff --git a/tests/schema/test_data/simulation_state_test_data.json b/tests/schema/test_data/simulation_state_test_data.json index 290f0c08..9e91a5c4 100644 --- a/tests/schema/test_data/simulation_state_test_data.json +++ b/tests/schema/test_data/simulation_state_test_data.json @@ -121,10 +121,6 @@ }, "b5c21c73-e155-4bad-928f-53eb87f7b2dc": { "current_tick": 1440, - "used_history": { - "2023-05-23T22:00": "-", - "2023-05-23T23:00": "-" - }, "used_storage": 0.12, "charge_history": { "2023-05-23T22:00": 10.0, diff --git a/tests/schema/test_settings_validator.py b/tests/schema/test_settings_validator.py index 813797ef..d6260000 100644 --- a/tests/schema/test_settings_validator.py +++ b/tests/schema/test_settings_validator.py @@ -34,7 +34,12 @@ def setup_method(self): "settlement_market_enabled": False, "relative_std_from_forecast_percent": 10.0, "bid_offer_match_algo": 1, - "scm_coefficient_algorithm": 1, + "scm": { + "name": "DEFAULT_STATIC", + "coefficient_algorithm": 2, + "grid_fees_reduction": 0.01, + "intracommunity_rate_base_eur": 0.5 + }, "type": 0 } @@ -62,7 +67,10 @@ def _assert_all_settings_values(settings: Dict, compare_timedeltas: bool): assert not settings["settlement_market_enabled"] assert settings["relative_std_from_forecast_percent"] == 10.0 assert settings["bid_offer_match_algo"] == 1 - assert settings["scm_coefficient_algorithm"] == 1 + assert settings["scm"]["name"] == "DEFAULT_STATIC" + assert settings["scm"]["coefficient_algorithm"] == 2 + assert isclose(settings["scm"]["grid_fees_reduction"], 0.01, rel_tol=0.0000001) + assert isclose(settings["scm"]["intracommunity_rate_base_eur"], 0.5, rel_tol=0.0000001) assert settings["type"] == 0 def test_simulation_settings_validator_works(self):