be.ac.ua.broker.scheduling.workload
Class ScheduledTaskCollection

java.lang.Object
  extended by be.ac.ua.broker.scheduling.workload.ScheduledTaskCollection

public class ScheduledTaskCollection
extends java.lang.Object

This class represents a schedule generated for a single instance, it contains a list of subTasks. During the allocation phase of the broker a pricing model will be associated with the scheduledTaskCollection.

Author:
Vermeersch Kurt

Constructor Summary
ScheduledTaskCollection()
           
 
Method Summary
 void add(SubTask subT)
          Add a subtask to the scheduledTaskCollection
 void fillInTimeStampsSubTasks(java.util.Date start)
          Associate time stamps with all the subTasks by providing a start time and using every subTask in the list as a one hour long time frame.
 ScheduledTaskCollection getNonSpotEnabledSubTasks()
           
 int getNumberOfSubTasks()
           
 int getNumberOfTaskHours()
          Getter for the number of actual task hours, which equals the size of the list with subtasks minus the amount of dummy subTasks in the list
 java.lang.String getPricingModel()
           
 ScheduledTaskCollection getSpotEnabledSubTasks()
           
 java.util.List<SubTask> getSubTasks()
           
 void merge(ScheduledTaskCollection newPart)
          Merge the provided scheduledTaskCollection with this scheduledTaskCollection,
 boolean onlyNonSpotEnabledTasks()
           
 boolean onlySpotEnabledSubTasks()
           
 void postFill(int postFillAmount)
          Add a given number of dummySubTasks after the subtasks already in the collection
 void preFill(int preFillAmount)
          Add a given number of dummySubTasks in front of the subtasks already in the collection
 void setPricesSubTasks(Price price)
          Setter for the price of all the subTasks of the scheduledTaskCollection, this can be used for the on-demand and reserved pricing models since all subtasks hold the same price in that case.
 void setPricingModel(java.lang.String model)
          Setter for the pricing model appointed to the instance associated with the scheduledTaskCollection ]
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScheduledTaskCollection

public ScheduledTaskCollection()
Method Detail

getSubTasks

public java.util.List<SubTask> getSubTasks()
Returns:
the list of subtasks associated with the scheduledTaskCollection

add

public void add(SubTask subT)
Add a subtask to the scheduledTaskCollection

Parameters:
subT - the subTask to add to the collection

merge

public void merge(ScheduledTaskCollection newPart)
Merge the provided scheduledTaskCollection with this scheduledTaskCollection,

Parameters:
newPart - the scheduledTaskCollection to merge with the current one

getNumberOfSubTasks

public int getNumberOfSubTasks()
Returns:
the number of subTasks in the scheduledTaskCollection

postFill

public void postFill(int postFillAmount)
Add a given number of dummySubTasks after the subtasks already in the collection

Parameters:
postFillAmount - the number of dummySubTasks to post append

preFill

public void preFill(int preFillAmount)
Add a given number of dummySubTasks in front of the subtasks already in the collection

Parameters:
preFillAmount - the number of dummySubTasks to pre append to the collection

getSpotEnabledSubTasks

public ScheduledTaskCollection getSpotEnabledSubTasks()
Returns:
the spot-enabled subtasks that are part of the scheduledTaskCollection

getNonSpotEnabledSubTasks

public ScheduledTaskCollection getNonSpotEnabledSubTasks()
Returns:
the not spot-enabled subtasks that are part of the scheduledTaskCollection

onlySpotEnabledSubTasks

public boolean onlySpotEnabledSubTasks()
Returns:
whether all the subTasks of the scheduledTaskCollection are spot enabled

onlyNonSpotEnabledTasks

public boolean onlyNonSpotEnabledTasks()
Returns:
whether all the subTasks of the scheduledTaskCollection are not spot enabled

getPricingModel

public java.lang.String getPricingModel()
Returns:
the pricing model that is appointed to the scheduledTaskCollection during the allocation phase of the broker process

setPricingModel

public void setPricingModel(java.lang.String model)
Setter for the pricing model appointed to the instance associated with the scheduledTaskCollection ]

Parameters:
model - the pricing model that has to be used

getNumberOfTaskHours

public int getNumberOfTaskHours()
Getter for the number of actual task hours, which equals the size of the list with subtasks minus the amount of dummy subTasks in the list

Returns:
the number of subtasks scheduled on the instance

setPricesSubTasks

public void setPricesSubTasks(Price price)
Setter for the price of all the subTasks of the scheduledTaskCollection, this can be used for the on-demand and reserved pricing models since all subtasks hold the same price in that case. When the spot pricing model is used, this method can't be used.

Parameters:
price - the price to set for all subtasks of the scheduledTaskCollection

fillInTimeStampsSubTasks

public void fillInTimeStampsSubTasks(java.util.Date start)
Associate time stamps with all the subTasks by providing a start time and using every subTask in the list as a one hour long time frame.

Parameters:
start - the start time of the scheduling period