Package org.powertac.common
Class MarketPosition
- java.lang.Object
- 
- org.powertac.common.MarketPosition
 
- 
 @Domain(fields={"broker","timeslot","balance"}) public class MarketPosition extends Object AMarketPositiondomain instance represents the current position of a single broker for wholesale power in a given timeslot. The evolution of this position over time is represented by the sequence of MarketTransaction instances for this broker and timeslot. These are created by the AccountingService and communicated to individual brokers after the market clears in each timeslot.- Author:
- Carsten Block, David Dauer, John Collins
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected longid
 - 
Constructor SummaryConstructors Constructor Description MarketPosition(Broker broker, int timeslot, double balance)MarketPosition(Broker broker, Timeslot timeslot, double balance)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description BrokergetBroker()longgetId()doublegetOverallBalance()TimeslotgetTimeslot()intgetTimeslotIndex()StringtoString()doubleupdateBalance(double mWh)Adds a quantity to the current balance.
 
- 
- 
- 
Constructor Detail- 
MarketPositionpublic MarketPosition(Broker broker, int timeslot, double balance) 
 - 
MarketPosition@ChainedConstructor public MarketPosition(Broker broker, Timeslot timeslot, double balance) 
 
- 
 - 
Method Detail- 
getIdpublic long getId() 
 - 
getBrokerpublic Broker getBroker() 
 - 
getTimeslotIndexpublic int getTimeslotIndex() 
 - 
getTimeslotpublic Timeslot getTimeslot() 
 - 
getOverallBalancepublic double getOverallBalance() 
 - 
updateBalance@StateChange public double updateBalance(double mWh) Adds a quantity to the current balance. Positive numbers signify purchased power, negative numbers signify sold power. Returns the resulting total balance
 
- 
 
-