Package org.powertac.tariffmarket
Class CapacityControlService
- java.lang.Object
-
- org.powertac.common.interfaces.TimeslotPhaseProcessor
-
- org.powertac.tariffmarket.CapacityControlService
-
- All Implemented Interfaces:
CapacityControl,InitializationService
@Service public class CapacityControlService extends TimeslotPhaseProcessor implements CapacityControl, InitializationService
Service for managing balancing and economic controls.- Author:
- John Collins
-
-
Constructor Summary
Constructors Constructor Description CapacityControlService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate(org.joda.time.Instant time, int phaseNumber)Activation applies pending ratio controls to subscriptions for the current timeslot.voidexerciseBalancingControl(BalancingOrder order, double kwh, double payment)Creates BalancingControlEvent, posts it on correct TariffSubscription instances.RegulationAccumulatorgetRegulationCapacity(BalancingOrder order)Gathers up power usage data for the current timeslot that could be subject to a BalancingOrder.Stringinitialize(Competition competition, List<String> completedInits)Initializes a plugin prior to the beginning of a game.voidpostEconomicControl(EconomicControlEvent event)Posts an EconomicControlEvent on the correct TariffSubscription instances.-
Methods inherited from class org.powertac.common.interfaces.TimeslotPhaseProcessor
init, setTimeslotPhase
-
-
-
-
Method Detail
-
initialize
public String initialize(Competition competition, List<String> completedInits)
Description copied from interface:InitializationServiceInitializes a plugin prior to the beginning of a game. The completedInits parameter is the list of plugin role names that have been successfully initialized. If sequence dependencies are satisfied (or if there are no sequence dependencies), then an implementation must complete its pre-game initialization process and return its role name. If sequence dependencies are not satisfied, then an implementation must return null. It will be called again after additional successful initializations have been completed. If initialization is not possible, then returning the string 'fail' will cause the server to log an error and shut down. This will be helpful just in case the implementation also logs a detailed error message.- Specified by:
initializein interfaceInitializationService
-
exerciseBalancingControl
public void exerciseBalancingControl(BalancingOrder order, double kwh, double payment)
Description copied from interface:CapacityControlCreates BalancingControlEvent, posts it on correct TariffSubscription instances. Up-regulation is represented by positive kwh (the market is getting more energy) and typically positive payment.- Specified by:
exerciseBalancingControlin interfaceCapacityControl
-
postEconomicControl
public void postEconomicControl(EconomicControlEvent event)
Description copied from interface:CapacityControlPosts an EconomicControlEvent on the correct TariffSubscription instances.- Specified by:
postEconomicControlin interfaceCapacityControl
-
getRegulationCapacity
public RegulationAccumulator getRegulationCapacity(BalancingOrder order)
Description copied from interface:CapacityControlGathers up power usage data for the current timeslot that could be subject to a BalancingOrder. Return value is in kwh.- Specified by:
getRegulationCapacityin interfaceCapacityControl
-
activate
public void activate(org.joda.time.Instant time, int phaseNumber)Activation applies pending ratio controls to subscriptions for the current timeslot.- Specified by:
activatein classTimeslotPhaseProcessor
-
-