be.ac.ua.broker.allocation.spot.model
Class SrcRecord

java.lang.Object
  extended by be.ac.ua.broker.allocation.spot.model.SrcRecord

public class SrcRecord
extends java.lang.Object

The SrcRecord class contains the price history data for the instance/category that is being simulated. It also determines the lowest and highest value for that category/instance type.

Author:
Vermeersch Kurt (Based on Sangho Yi c++ implementation of the spot model)

Constructor Summary
SrcRecord(java.lang.String fileName, java.lang.String instance)
          Constructor for SrcRecord
 
Method Summary
 void determineLowestAndHighest()
          Determine the lowest and highest historic price.
 java.lang.String getFileName()
           
 java.lang.Double getHighest()
          Getter for the highest value/spot price .
 java.lang.String getInstanceType()
           
 java.lang.Double getLowest()
          Getter for the lowest value/spot price.
 int getRecord()
           
 double[] getSrcdata()
          Getter for the array containing all the spot prices over time
 void setData(int i, double val)
          Setter for the historic spot price of the given record.
 void setRecord(int rec)
          Setter for the number of records
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SrcRecord

public SrcRecord(java.lang.String fileName,
                 java.lang.String instance)
Constructor for SrcRecord

Parameters:
fileName - name of the price history input CSV file
instance - the instance type/category the corresponding file contains the data of
Method Detail

setData

public void setData(int i,
                    double val)
Setter for the historic spot price of the given record.

Parameters:
i - the record number
val - the price value

getSrcdata

public double[] getSrcdata()
Getter for the array containing all the spot prices over time

Returns:
the requested spot price history data

setRecord

public void setRecord(int rec)
Setter for the number of records

Parameters:
cat - the number of records

getRecord

public int getRecord()
Returns:
number of records

getLowest

public java.lang.Double getLowest()
Getter for the lowest value/spot price.

Returns:
the lowest historic spot price

getHighest

public java.lang.Double getHighest()
Getter for the highest value/spot price .

Returns:
the highest historic spot price

getFileName

public java.lang.String getFileName()
Returns:
the name of the price history input CSV file

getInstanceType

public java.lang.String getInstanceType()
Returns:
the instance type/category the spot price history is for

determineLowestAndHighest

public void determineLowestAndHighest()
Determine the lowest and highest historic price.