Package org.powertac.common
Class Timeslot
- java.lang.Object
- 
- org.powertac.common.Timeslot
 
- 
- All Implemented Interfaces:
- Comparable<Object>
 
 public class Timeslot extends Object implements Comparable<Object> A timeslot instance describes an interval of time (slot) for which power may be traded in the wholesale market. The duration of a timeslot is given bycurrentCompetition.getTimeslotLength(). Timeslots are uniquely identified by their serial numbers, which is the number of timeslots sincecurrentCompetition.getSimulationBaseTime().Timeslots are used (i) to correlate tradeable products (energy futures) and trades in the market with a future time interval where settlement (i.e. delivery / consumption) has to take place, (ii) to correlate meter readings with a duration in time, (iii) to allow tariffs to define different consumption / production prices for different times of a day. Timeslots are represented in server-broker communications by serial number. This is an immutable type, so no state logging is needed. Creation events are logged by the repository. - Author:
- Carsten Block, John Collins
 
- 
- 
Constructor SummaryConstructors Constructor Description Timeslot(int serial, org.joda.time.Instant start)Constructor is intended to be called by repository.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Object arg)intdayOfWeek()Returns the day of week for the start of this timeslot, starting at Monday = 1.org.joda.time.InstantgetEndInstant()longgetId()intgetSerialNumber()org.joda.time.InstantgetStartInstant()org.joda.time.DateTimegetStartTime()Returns the DateTime representation of the start time for this timeslotintslotInDay()Returns the timeslot index since the most recent midnight, starting at zero.StringtoString()
 
- 
- 
- 
Method Detail- 
getSerialNumberpublic int getSerialNumber() 
 - 
getIdpublic long getId() 
 - 
getStartInstantpublic org.joda.time.Instant getStartInstant() 
 - 
getEndInstantpublic org.joda.time.Instant getEndInstant() 
 - 
getStartTimepublic org.joda.time.DateTime getStartTime() Returns the DateTime representation of the start time for this timeslot
 - 
slotInDaypublic int slotInDay() Returns the timeslot index since the most recent midnight, starting at zero. Note that this is hourOfDay if timeslots are one hour. Assumes tz = 0.
 - 
dayOfWeekpublic int dayOfWeek() Returns the day of week for the start of this timeslot, starting at Monday = 1.
 - 
compareTopublic int compareTo(Object arg) - Specified by:
- compareToin interface- Comparable<Object>
 
 
- 
 
-