Skip to content

Commit

Permalink
GSYE-804: Added collective self consumption scheme option.
Browse files Browse the repository at this point in the history
  • Loading branch information
spyrostz committed Oct 30, 2024
1 parent 90304b3 commit 3db02ae
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions gsy_framework/constants_limits.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,15 @@

from pendulum import duration, instance

from gsy_framework.enums import (AvailableMarketTypes, BidOfferMatchAlgoEnum,
CoefficientAlgorithm, HeatPumpSourceType,
SpotMarketTypeEnum, ConfigurationType)
from gsy_framework.enums import (
AvailableMarketTypes,
BidOfferMatchAlgoEnum,
CoefficientAlgorithm,
HeatPumpSourceType,
SpotMarketTypeEnum,
ConfigurationType,
SCMSelfConsumptionType,
)

RangeLimit = namedtuple("RangeLimit", ("min", "max"))
RateRange = namedtuple("RateRange", ("initial", "final"))
Expand Down Expand Up @@ -89,6 +95,7 @@ class FutureMarketSettings:

class ForwardMarketSettings:
"""Default settings for forward markets"""

ENABLE_FORWARD_MARKETS = False
FULLY_AUTO_TRADING = True

Expand Down Expand Up @@ -185,6 +192,7 @@ class WindSettings:

class HeatPumpSettings:
"""Default values for the heat pump."""

# range limits
MAX_POWER_RATING_KW_LIMIT = RangeLimit(0, sys.maxsize)
TEMP_C_LIMIT = RangeLimit(0.0, 200.0)
Expand Down Expand Up @@ -258,17 +266,21 @@ 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)
HOURS_OF_DELAY = 72
SELF_CONSUMPTION_TYPE = SCMSelfConsumptionType.COLLECTIVE_SELF_CONSUMPTION_SURPLUS_42.value


def is_no_community_self_consumption() -> bool:
"""Check whether the SCM mode is set to no-community-self-consumption."""
return (ConstSettings.SCMSettings.MARKET_ALGORITHM ==
CoefficientAlgorithm.NO_COMMUNITY_SELF_CONSUMPTION.value)
return (

Check warning on line 280 in gsy_framework/constants_limits.py

View check run for this annotation

Codecov / codecov/patch

gsy_framework/constants_limits.py#L280

Added line #L280 was not covered by tests
ConstSettings.SCMSettings.MARKET_ALGORITHM
== CoefficientAlgorithm.NO_COMMUNITY_SELF_CONSUMPTION.value
)


class GlobalConfig:
Expand Down Expand Up @@ -306,6 +318,7 @@ def is_canary_network(cls):

class HeartBeat:
"""Default settings for heartbeat functionalities (to check the liveness of simulations)."""

RATE = 5 # in secs
TOLERANCE = 16 # in secs

Expand Down Expand Up @@ -334,5 +347,5 @@ class HeartBeat:
AvailableMarketTypes.DAY_FORWARD,
AvailableMarketTypes.WEEK_FORWARD,
AvailableMarketTypes.MONTH_FORWARD,
AvailableMarketTypes.YEAR_FORWARD
AvailableMarketTypes.YEAR_FORWARD,
]

0 comments on commit 3db02ae

Please sign in to comment.