Skip to content

Commit

Permalink
Merge pull request #547 from gridsingularity/feature/GSYE-804
Browse files Browse the repository at this point in the history
Feature/gsye 804
  • Loading branch information
spyrostz authored Oct 30, 2024
2 parents a379351 + 3db02ae commit 8192fda
Show file tree
Hide file tree
Showing 2 changed files with 27 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 (
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,
]
8 changes: 8 additions & 0 deletions gsy_framework/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,11 @@ def member_names(cls) -> List:
"market_maker_rate": SCMPropertyType.AREA_PROPERTIES,
"feed_in_tariff": SCMPropertyType.AREA_PROPERTIES,
}


class SCMSelfConsumptionType(Enum):
"""Self consumption type for SCM algorithm."""

SIMPLIFIED_COLLECTIVE_SELF_CONSUMPTION_41 = 0
COLLECTIVE_SELF_CONSUMPTION_SURPLUS_42 = 1
NO_SELF_CONSUMPTION = 2

0 comments on commit 8192fda

Please sign in to comment.