|
GridSim 5.0 beta | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectResourceCalendar
public class ResourceCalendar
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.
| Constructor Summary | |
|---|---|
ResourceCalendar(double[] regularLoad,
double timeZone,
double peakLoad,
double offPeakLoad,
double relativeHolidayLoad,
LinkedList weekendList,
LinkedList holidayList,
long seed)
Allocates a new ResourceCalendar object with a pre-defined daily regular load |
|
ResourceCalendar(double timeZone,
double peakLoad,
double offPeakLoad,
double relativeHolidayLoad,
LinkedList weekendList,
LinkedList holidayList,
long seed)
Allocates a new ResourceCalendar object with a default daily regular load. |
|
| Method Summary | |
|---|---|
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(Date date)
Checks whether the given date is a holiday or not |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ResourceCalendar(double timeZone,
double peakLoad,
double offPeakLoad,
double relativeHolidayLoad,
LinkedList weekendList,
LinkedList holidayList,
long seed)
timeZone - time zonepeakLoad - the load during peak time, with range: [0 ... 1]offPeakLoad - the load during off peak time, with range: [0 ... 1]relativeHolidayLoad - the load during holidays,
with range: [0 ... 1]weekendList - a list of Integer numbers for weekendsholidayList - a list of Integer numbers for holidaysseed - the initial seed
public ResourceCalendar(double[] regularLoad,
double timeZone,
double peakLoad,
double offPeakLoad,
double relativeHolidayLoad,
LinkedList weekendList,
LinkedList holidayList,
long seed)
regularLoad - the daily regular load, with range: [0 ... 1].
Note that regularLoad[0] represents time 00:00 (hh:mm),
and regularLoad[23] represents time 23:00.timeZone - time zonepeakLoad - the load during peak time, with range: [0 ... 1]offPeakLoad - the load during off peak time, with range: [0 ... 1]relativeHolidayLoad - the load during holidays,
with range: [0 ... 1]weekendList - a list of Integer numbers for weekendsholidayList - a list of Integer numbers for holidaysseed - the initial seed| Method Detail |
|---|
public Calendar getCalendarAtSimulationTime(double simulationTime)
throws NullPointerException
simulationTime - the simulation time
NullPointerException - if GridSim.init() has not been
called beforeGridSim.init(int, Calendar, boolean, String[], String[],
String)
public Calendar getCurrentCalendar()
throws NullPointerException
NullPointerException - if GridSim.init() has not been
called beforeGridSim.init(int, Calendar, boolean, String[], String[],
String),
Sim_system.clock()
public double getSimulationTime(Calendar localTime)
throws NullPointerException
localTime - a Calendar object
NullPointerException - if localTime is null
or GridSim.init() has not been
called beforeGridSim.init(int, Calendar, boolean, String[], String[],
String)public Calendar getCalendarAtGivenDate(Date date)
date - the Date object
public boolean isHoliday()
throws NullPointerException
NullPointerException - if GridSim.init() has not been
called beforeGridSim.init(int, Calendar, boolean, String[], String[],
String)public boolean isHoliday(Date date)
date - the Date object
public double getCurrentLoad()
throws NullPointerException
NullPointerException - if GridSim.init() has not been
called beforeGridSim.init(int, Calendar, boolean, String[], String[],
String)
|
GridSim 5.0 beta | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||