Package org.powertac.balancemkt
Class BalancingMarketService
- java.lang.Object
-
- org.powertac.common.interfaces.TimeslotPhaseProcessor
-
- org.powertac.balancemkt.BalancingMarketService
-
- All Implemented Interfaces:
SettlementContext
,BalancingMarket
,InitializationService
@Service public class BalancingMarketService extends TimeslotPhaseProcessor implements BalancingMarket, SettlementContext, InitializationService
-
-
Constructor Summary
Constructors Constructor Description BalancingMarketService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
activate(org.joda.time.Instant time, int phaseNumber)
This method gets called once during each timeslot.Map<Broker,ChargeInfo>
balanceTimeslot(List<Broker> brokerList, org.powertac.balancemkt.BalancingMarketService.DoubleWrapper report)
Generates a list of Transactions that balance the overall market.Double
getBalancingCost()
Returns the per-timeslot charge for running the balancing marketDouble
getDefaultSpotPrice()
Returns the value used for spot price per MWh if unavailable from wholesale market.double
getMarketBalance(Broker broker)
Returns the difference between a broker's current market position and its net load.Double
getPMinus()
Returns the zero-quantity price for down-regulation energy in the current timeslot.Double
getPMinusPrime()
Returns the slope of down-regulation energy sold through the wholesale ancillary services market.Double
getPPlus()
Returns the zero-quantity price for up-regulation energy in the current timeslot.Double
getPPlusPrime()
Returns the slope of up-regulation energy purchased through the wholesale ancillary services market.double
getRegulation(Broker broker)
Returns the net balancing result for a given broker.String
initialize(Competition competition, List<String> completedInits)
Computes actual distribution and balancing costs by random selection-
Methods inherited from class org.powertac.common.interfaces.TimeslotPhaseProcessor
init, setTimeslotPhase
-
-
-
-
Method Detail
-
initialize
public String initialize(Competition competition, List<String> completedInits)
Computes actual distribution and balancing costs by random selection- Specified by:
initialize
in interfaceInitializationService
-
activate
public void activate(org.joda.time.Instant time, int phaseNumber)
Description copied from class:TimeslotPhaseProcessor
This method gets called once during each timeslot. To get called, the module must first call the register(phaseNumber) method on CompetitionControl. The call will give the current simulation time and phase number in the arguments.- Specified by:
activate
in classTimeslotPhaseProcessor
-
balanceTimeslot
public Map<Broker,ChargeInfo> balanceTimeslot(List<Broker> brokerList, org.powertac.balancemkt.BalancingMarketService.DoubleWrapper report)
Generates a list of Transactions that balance the overall market. Transactions are generated on a per-broker basis depending on the broker's balance within its own market.- Returns:
- List of ChargeInfo instances
-
getMarketBalance
public double getMarketBalance(Broker broker)
Returns the difference between a broker's current market position and its net load. Note: market position is computed in MWh and net load is computed in kWh, conversion is needed to compute the difference in kWh.- Specified by:
getMarketBalance
in interfaceBalancingMarket
- Returns:
- a broker's current energy balance within its market. Pos for over-production, neg for under-production
-
getRegulation
public double getRegulation(Broker broker)
Returns the net balancing result for a given broker. Valid only after service activation within a given timeslot.- Specified by:
getRegulation
in interfaceBalancingMarket
-
getPPlus
public Double getPPlus()
Returns the zero-quantity price for up-regulation energy in the current timeslot. Value is positive per kWh- Specified by:
getPPlus
in interfaceSettlementContext
-
getPMinus
public Double getPMinus()
Returns the zero-quantity price for down-regulation energy in the current timeslot. Price is per kWh.- Specified by:
getPMinus
in interfaceSettlementContext
-
getPPlusPrime
public Double getPPlusPrime()
Returns the slope of up-regulation energy purchased through the wholesale ancillary services market.- Specified by:
getPPlusPrime
in interfaceBalancingMarket
-
getPMinusPrime
public Double getPMinusPrime()
Returns the slope of down-regulation energy sold through the wholesale ancillary services market.- Specified by:
getPMinusPrime
in interfaceBalancingMarket
-
getBalancingCost
public Double getBalancingCost()
Description copied from interface:BalancingMarket
Returns the per-timeslot charge for running the balancing market- Specified by:
getBalancingCost
in interfaceBalancingMarket
-
getDefaultSpotPrice
public Double getDefaultSpotPrice()
Description copied from interface:BalancingMarket
Returns the value used for spot price per MWh if unavailable from wholesale market.- Specified by:
getDefaultSpotPrice
in interfaceBalancingMarket
-
-