be.ac.ua.broker.input.pricing
Class SpotCSVHandler

java.lang.Object
  extended by be.ac.ua.broker.input.pricing.CSVHandler
      extended by be.ac.ua.broker.input.pricing.SpotCSVHandler

public class SpotCSVHandler
extends CSVHandler

Class that extends the CSVHandler in order to handle spot price access

Author:
Vermeersch Kurt

Field Summary
 
Fields inherited from class be.ac.ua.broker.input.pricing.CSVHandler
fContents
 
Constructor Summary
SpotCSVHandler(java.lang.String inputLocation)
          Constructor for SpotCSVHandler
 
Method Summary
 java.lang.Double getHighValue(InstanceSpecification inst, java.util.Date start, java.util.Date end, int index)
          Get the spot price value that is the tipping point bid that enables the optimal scheduling of the subtasks
 org.apache.commons.math.stat.descriptive.DescriptiveStatistics getSpotStatistics(InstanceSpecification inst, java.util.Date start, java.util.Date end)
          Getter for the spot price history statistics within the given time frame for the given instance specification
 java.lang.String getSpotValue(InstanceSpecification inst, java.util.Date timestamp)
          Getter for the spot price of the given instance at a certain moment in time using the pricing model associated with the PriceWatch implementation
 void update(java.lang.String inputLocation)
          Update the spot price access, reload the prices form file.
 
Methods inherited from class be.ac.ua.broker.input.pricing.CSVHandler
getHighValue, getStatistics, getValue, parse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpotCSVHandler

public SpotCSVHandler(java.lang.String inputLocation)
Constructor for SpotCSVHandler

Parameters:
inputLocation - the location of the spot price history input files
Method Detail

getSpotValue

public java.lang.String getSpotValue(InstanceSpecification inst,
                                     java.util.Date timestamp)
                              throws InstanceNotAvailableException
Getter for the spot price of the given instance at a certain moment in time using the pricing model associated with the PriceWatch implementation

Parameters:
inst - the instance specification to get the spot price for
timestamp - time to get the spot price for
Returns:
the price for the given instance at the given moment in time
Throws:
InstanceNotAvailableException

update

public void update(java.lang.String inputLocation)
Update the spot price access, reload the prices form file.

Parameters:
inputLocation - the location of the spot price history input files

getSpotStatistics

public org.apache.commons.math.stat.descriptive.DescriptiveStatistics getSpotStatistics(InstanceSpecification inst,
                                                                                        java.util.Date start,
                                                                                        java.util.Date end)
                                                                                 throws InstanceNotAvailableException
Getter for the spot price history statistics within the given time frame for the given instance specification

Parameters:
inst - the instance specification to get the spot price statistics for
start - the start date of the time frame to get the spot price statistics for
end - the end date of the time frame to get the spot price statistics for
Returns:
the spot price statistics that were requested for a certain instance specification and time frame
Throws:
InstanceNotAvailableException

getHighValue

public java.lang.Double getHighValue(InstanceSpecification inst,
                                     java.util.Date start,
                                     java.util.Date end,
                                     int index)
                              throws InstanceNotAvailableException
Get the spot price value that is the tipping point bid that enables the optimal scheduling of the subtasks

Parameters:
inst - the instance specification to get the spot bid for
start - the start of the time frame to get the spot bid for
end - the end of the time frame to get the spot bid for
index - number of hours the spot price does not need to be available
Returns:
the requested spot price value
Throws:
java.lang.Exception
InstanceNotAvailableException