org.powertac.common
Class Timeslot

java.lang.Object
  extended by org.powertac.common.Timeslot

public class Timeslot
extends Object

A timeslot instance describes an interval of time (slot) for which power may be traded in the wholesale market. Time slots 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 and start time.

This is an immutable type, so no state logging is needed. Creation events are logged by the repository.

Version:
1.0 - Feb,6,2011
Author:
Carsten Block

Constructor Summary
Timeslot(int serial, org.joda.time.Instant start, Timeslot previous)
          Constructor is intended to be called by repository.
 
Method Summary
 void disable()
           
 void enable()
           
 org.joda.time.Instant getEndInstant()
           
 long getId()
           
 Timeslot getNext()
           
 Timeslot getPrevious()
           
 int getSerialNumber()
           
 org.joda.time.Instant getStartInstant()
           
 boolean isEnabled()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Timeslot

public Timeslot(int serial,
                org.joda.time.Instant start,
                Timeslot previous)
Constructor is intended to be called by repository. Note that Timeslots are created in sequence, and are initially enabled. If you want to create a disabled timeslot, you have to call disable() after creating it.

Method Detail

getSerialNumber

public int getSerialNumber()

getId

public long getId()

isEnabled

public boolean isEnabled()

enable

public void enable()

disable

public void disable()

getStartInstant

public org.joda.time.Instant getStartInstant()

getEndInstant

public org.joda.time.Instant getEndInstant()

toString

public String toString()
Overrides:
toString in class Object

getNext

public Timeslot getNext()

getPrevious

public Timeslot getPrevious()


Copyright © 2012. All Rights Reserved.