GridSim
v3.0

gridsim
Class ResourceCalendar

Object
  extended bygridsim.ResourceCalendar

public class ResourceCalendar
extends Object

GridSim ResourceCalendar class implements a mechanism to support modeling a local load on Grid resources that may vary according to the time zone, time, weekends and holidays.

Since:
GridSim Toolkit 1.0
Version:
3.0, May 2004
Author:
Manzur Murshed and Rajkumar Buyya
Invariant:
$none

Constructor Summary
ResourceCalendar(double timeZone, double peakLoad, double offPeakLoad, double relativeHolidayLoad, LinkedList weekendList, LinkedList holidayList, long seed)
          Allocates a new ResourceCalendar object
 
Method Summary
 Calendar CalendarAtGivenDate(Date date)
          Deprecated. As of GridSim 2.1, replaced by getCalendarAtGivenDate(Date)
 Calendar CalendarAtGivenSimTime(double simulationTime)
          Deprecated. As of GridSim 2.1, replaced by getCalendarAtSimulationTime(double)
 Calendar CalendarNow()
          Deprecated. As of GridSim 2.1, replaced by getCurrentCalendar()
 double CurrentLoad()
          Deprecated. As of GridSim 2.1, replaced by getCurrentLoad()
 Calendar getCalendarAtGivenDate(Date date)
          Gets a Calendar object at the specified date
 Calendar getCalendarAtSimulationTime(double simulationTime)
          Gets a Calendar object for a specified simulation time
 Calendar getCurrentCalendar()
          Gets the current Calendar object (based on the simulation clock)
 double getCurrentLoad()
          Gets the current load for the current simulation time
 double getSimulationTime(Calendar localTime)
          Gets the current simulation time
 boolean isHoliday()
          Checks whether the current simulation time is a holiday or not
 boolean IsHoliday()
          Deprecated. As of GridSim 2.1, replaced by isHoliday()
 boolean isHoliday(Date date)
          Checks whether the given date is a holiday or not
 boolean IsHoliday(Date date)
          Deprecated. As of GridSim 2.1, replaced by isHoliday(Date)
 double SimulationTime(Calendar localTime)
          Deprecated. As of GridSim 2.1, replaced by getSimulationTime(Calendar)
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceCalendar

public ResourceCalendar(double timeZone,
                        double peakLoad,
                        double offPeakLoad,
                        double relativeHolidayLoad,
                        LinkedList weekendList,
                        LinkedList holidayList,
                        long seed)
Allocates a new ResourceCalendar object

Parameters:
timeZone - time zone
peakLoad - the load during peak time
offPeakLoad - the load during off peak time
relativeHolidayLoad - the load during holidays
weekendList - a list of Integer numbers for weekends
holidayList - a list of Integer numbers for holidays
seed - the initial seed
Pre Condition:
timeZone >= 0.0, peakLoad >= 0.0, offPeakLoad >= 0.0, relativeHolidayLoad >= 0.0, seed > 0
Post Condition:
$none
Method Detail

CalendarAtGivenSimTime

public Calendar CalendarAtGivenSimTime(double simulationTime)
                                          throws NullPointerException
Deprecated. As of GridSim 2.1, replaced by getCalendarAtSimulationTime(double)

Gets a Calendar object for a specified simulation time

Parameters:
simulationTime - the simulation time
Returns:
a Calendar object
Throws:
NullPointerException - if GridSim.init() has not been called before
See Also:
GridSim.init(int, Calendar, boolean, String[], String[], String)
Pre Condition:
simulationTime >= 0.0
Post Condition:
$result != null

getCalendarAtSimulationTime

public Calendar getCalendarAtSimulationTime(double simulationTime)
                                               throws NullPointerException
Gets a Calendar object for a specified simulation time

Parameters:
simulationTime - the simulation time
Returns:
a Calendar object
Throws:
NullPointerException - if GridSim.init() has not been called before
See Also:
GridSim.init(int, Calendar, boolean, String[], String[], String)
Pre Condition:
simulationTime >= 0.0
Post Condition:
$result != null

CalendarNow

public Calendar CalendarNow()
                               throws NullPointerException
Deprecated. As of GridSim 2.1, replaced by getCurrentCalendar()

Gets the current Calendar object (based on the simulation clock)

Returns:
the current Calendar object
Throws:
NullPointerException - if GridSim.init() has not been called before
See Also:
GridSim.init(int, Calendar, boolean, String[], String[], String), Sim_system.clock()
Pre Condition:
$none
Post Condition:
$result != null

getCurrentCalendar

public Calendar getCurrentCalendar()
                                      throws NullPointerException
Gets the current Calendar object (based on the simulation clock)

Returns:
the current Calendar object
Throws:
NullPointerException - if GridSim.init() has not been called before
See Also:
GridSim.init(int, Calendar, boolean, String[], String[], String), Sim_system.clock()
Pre Condition:
$none
Post Condition:
$result != null

SimulationTime

public double SimulationTime(Calendar localTime)
                      throws NullPointerException
Deprecated. As of GridSim 2.1, replaced by getSimulationTime(Calendar)

Gets the current simulation time

Parameters:
localTime - a Calendar object
Returns:
the current simulation time
Throws:
NullPointerException - if localTime is null or GridSim.init() has not been called before
See Also:
GridSim.init(int, Calendar, boolean, String[], String[], String)
Pre Condition:
localTime != null
Post Condition:
$result >= 0.0

getSimulationTime

public double getSimulationTime(Calendar localTime)
                         throws NullPointerException
Gets the current simulation time

Parameters:
localTime - a Calendar object
Returns:
the current simulation time
Throws:
NullPointerException - if localTime is null or GridSim.init() has not been called before
See Also:
GridSim.init(int, Calendar, boolean, String[], String[], String)
Pre Condition:
localTime != null
Post Condition:
$result >= 0.0

CalendarAtGivenDate

public Calendar CalendarAtGivenDate(Date date)
Deprecated. As of GridSim 2.1, replaced by getCalendarAtGivenDate(Date)

Gets a Calendar object at the specified date

Parameters:
date - the Date object
Returns:
the Calendar object
Pre Condition:
date != null
Post Condition:
$result != null

getCalendarAtGivenDate

public Calendar getCalendarAtGivenDate(Date date)
Gets a Calendar object at the specified date

Parameters:
date - the Date object
Returns:
the Calendar object
Pre Condition:
date != null
Post Condition:
$result != null

IsHoliday

public boolean IsHoliday()
                  throws NullPointerException
Deprecated. As of GridSim 2.1, replaced by isHoliday()

Checks whether the current simulation time is a holiday or not

Returns:
true if it is a holiday, otherwise returns false
Throws:
NullPointerException - if GridSim.init() has not been called before
See Also:
GridSim.init(int, Calendar, boolean, String[], String[], String)
Pre Condition:
$none
Post Condition:
$result == true || $result == false

isHoliday

public boolean isHoliday()
                  throws NullPointerException
Checks whether the current simulation time is a holiday or not

Returns:
true if it is a holiday, otherwise returns false
Throws:
NullPointerException - if GridSim.init() has not been called before
See Also:
GridSim.init(int, Calendar, boolean, String[], String[], String)
Pre Condition:
$none
Post Condition:
$result == true || $result == false

IsHoliday

public boolean IsHoliday(Date date)
Deprecated. As of GridSim 2.1, replaced by isHoliday(Date)

Checks whether the given date is a holiday or not

Parameters:
date - the Date object
Returns:
true if it is a holiday, otherwise returns false
Pre Condition:
date != null
Post Condition:
$result == true || $result == false

isHoliday

public boolean isHoliday(Date date)
Checks whether the given date is a holiday or not

Parameters:
date - the Date object
Returns:
true if it is a holiday, otherwise returns false
Pre Condition:
date != null
Post Condition:
$result == true || $result == false

CurrentLoad

public double CurrentLoad()
                   throws NullPointerException
Deprecated. As of GridSim 2.1, replaced by getCurrentLoad()

Gets the current load for the current simulation time

Returns:
the current load
Throws:
NullPointerException - if GridSim.init() has not been called before
See Also:
GridSim.init(int, Calendar, boolean, String[], String[], String)
Pre Condition:
$none
Post Condition:
$result >= 0.0

getCurrentLoad

public double getCurrentLoad()
                      throws NullPointerException
Gets the current load for the current simulation time

Returns:
the current load
Throws:
NullPointerException - if GridSim.init() has not been called before
See Also:
GridSim.init(int, Calendar, boolean, String[], String[], String)
Pre Condition:
$none
Post Condition:
$result >= 0.0

GridSim
v3.0

The University of Melbourne, Australia, 2004