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 voidactivate(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.DoublegetBalancingCost()Returns the per-timeslot charge for running the balancing marketDoublegetDefaultSpotPrice()Returns the value used for spot price per MWh if unavailable from wholesale market.doublegetMarketBalance(Broker broker)Returns the difference between a broker's current market position and its net load.DoublegetPMinus()Returns the zero-quantity price for down-regulation energy in the current timeslot.DoublegetPMinusPrime()Returns the slope of down-regulation energy sold through the wholesale ancillary services market.DoublegetPPlus()Returns the zero-quantity price for up-regulation energy in the current timeslot.DoublegetPPlusPrime()Returns the slope of up-regulation energy purchased through the wholesale ancillary services market.doublegetRegulation(Broker broker)Returns the net balancing result for a given broker.Stringinitialize(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:
initializein interfaceInitializationService
-
activate
public void activate(org.joda.time.Instant time, int phaseNumber)Description copied from class:TimeslotPhaseProcessorThis 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:
activatein 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:
getMarketBalancein 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:
getRegulationin 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:
getPPlusin interfaceSettlementContext
-
getPMinus
public Double getPMinus()
Returns the zero-quantity price for down-regulation energy in the current timeslot. Price is per kWh.- Specified by:
getPMinusin interfaceSettlementContext
-
getPPlusPrime
public Double getPPlusPrime()
Returns the slope of up-regulation energy purchased through the wholesale ancillary services market.- Specified by:
getPPlusPrimein interfaceBalancingMarket
-
getPMinusPrime
public Double getPMinusPrime()
Returns the slope of down-regulation energy sold through the wholesale ancillary services market.- Specified by:
getPMinusPrimein interfaceBalancingMarket
-
getBalancingCost
public Double getBalancingCost()
Description copied from interface:BalancingMarketReturns the per-timeslot charge for running the balancing market- Specified by:
getBalancingCostin interfaceBalancingMarket
-
getDefaultSpotPrice
public Double getDefaultSpotPrice()
Description copied from interface:BalancingMarketReturns the value used for spot price per MWh if unavailable from wholesale market.- Specified by:
getDefaultSpotPricein interfaceBalancingMarket
-
-