|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object Thread Sim_entity GridSimCore GridResourceWithFailure
public class GridResourceWithFailure
GridResourceWithFailure is based on GridResource
, but with
added failure functionalities.
GridResourceWithFailure extends the GridSimCore
class for
gaining communication and concurrent entity capabilities.
An instance of this class stimulates a resource
with properties defined in an object of
ResourceCharacteristics
class.
GridResource
,
ResourceCharacteristics
,
AllocPolicyWithFailure
Nested Class Summary |
---|
Nested classes/interfaces inherited from class Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
protected AllocPolicy |
policy_
A resource's scheduler. |
protected int |
policyType_
A scheduler type of this resource, such as FCFS, Round Robin, etc |
protected String |
regionalGISName_
Regional GIS entity name |
protected ResourceCalendar |
resCalendar_
a ResourceCalendar object |
protected ResourceCharacteristics |
resource_
Characteristics of this resource |
protected int |
SIZE
Integer object size, including its overhead |
Fields inherited from class GridSimCore |
---|
input, NETWORK_TYPE, output |
Fields inherited from class Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
GridResourceWithFailure(String name,
double baud_rate,
long seed,
ResourceCharacteristics resource,
double peakLoad,
double offPeakLoad,
double relativeHolidayLoad,
LinkedList weekends,
LinkedList holidays)
Allocates a new GridResourceWithFailure object. |
|
GridResourceWithFailure(String name,
double baud_rate,
ResourceCharacteristics resource,
ResourceCalendar calendar)
Allocates a new GridResourceWithFailure object. |
|
GridResourceWithFailure(String name,
double baud_rate,
ResourceCharacteristics resource,
ResourceCalendar calendar,
AllocPolicyWithFailure policy)
Allocates a new GridResourceWithFailure object. |
|
GridResourceWithFailure(String name,
Link link,
long seed,
ResourceCharacteristics resource,
double peakLoad,
double offPeakLoad,
double relativeHolidayLoad,
LinkedList weekends,
LinkedList holidays)
Allocates a new GridResourceWithFailure object. |
|
GridResourceWithFailure(String name,
Link link,
ResourceCharacteristics resource,
ResourceCalendar calendar)
Allocates a new GridResourceWithFailure object. |
|
GridResourceWithFailure(String name,
Link link,
ResourceCharacteristics resource,
ResourceCalendar calendar,
AllocPolicyWithFailure policy)
Allocates a new GridResourceWithFailure object. |
Method Summary | |
---|---|
void |
body()
Handles external events that are coming to this GridResourceWithFailure entity. |
protected void |
processOtherEvent(Sim_event ev)
Overrides this method when making a new and different type of resource. |
protected void |
registerOtherEntity()
Overrides this method when making a new and different type of resource. |
boolean |
setRegionalGIS(AbstractGIS gis)
Sets a regional GridInformationService (GIS) entity for this resource to communicate with. |
boolean |
setRegionalGIS(String regionalGIS)
Sets a regional GridInformationService (GIS) entity for this resource to communicate with. |
void |
setTrace(boolean trace)
Asks this resource to record its activities. |
protected void |
write(String event,
int numMachines)
Write an event of this entity into a file. |
Methods inherited from class GridSimCore |
---|
finalizeGridSimulation, getLink, getPingResult, isNetworked, ping, ping, ping, ping, pingBlockingCall, pingBlockingCall, pingBlockingCall, pingBlockingCall, send, send, send, send, send, send, setBackgroundTraffic, setBackgroundTraffic, terminateIOEntities |
Methods inherited from class Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected ResourceCharacteristics resource_
protected ResourceCalendar resCalendar_
protected AllocPolicy policy_
protected int policyType_
protected final int SIZE
protected String regionalGISName_
Constructor Detail |
---|
public GridResourceWithFailure(String name, double baud_rate, long seed, ResourceCharacteristics resource, double peakLoad, double offPeakLoad, double relativeHolidayLoad, LinkedList weekends, LinkedList holidays) throws Exception
GridResourceWithFailure(String, double, ResourceCharacteristics,
ResourceCalendar, AllocPolicyWithFailure)
and then overrides processOtherEvent(Sim_event)
.
name
- the name to be associated with this entity (as
required by Sim_entity class from simjava package)baud_rate
- network communication or bandwidth speedseed
- the initial seedresource
- an object of ResourceCharacteristicspeakLoad
- the load during peak timesoffPeakLoad
- the load during off peak timesrelativeHolidayLoad
- the load during holiday timesweekends
- a linked-list contains the weekend daysholidays
- a linked-list contains the public holidays
Exception
- This happens when one of the following scenarios occur:
GridSim.init(int, Calendar, boolean, String[], String[],
String)
,
GridSim.init(int, Calendar, boolean)
,
GridResourceWithFailure(String, double,
ResourceCharacteristics, ResourceCalendar, AllocPolicyWithFailure)
public GridResourceWithFailure(String name, double baud_rate, ResourceCharacteristics resource, ResourceCalendar calendar) throws Exception
GridResourceWithFailure(String, double, ResourceCharacteristics,
ResourceCalendar, AllocPolicyWithFailure)
and then overrides processOtherEvent(Sim_event)
.
name
- the name to be associated with this entity (as
required by Sim_entity class from simjava package)baud_rate
- network communication or bandwidth speedresource
- an object of ResourceCharacteristicscalendar
- an object of ResourceCalendar
Exception
- This happens when one of the following scenarios occur:
GridSim.init(int, Calendar, boolean, String[], String[],
String)
,
GridSim.init(int, Calendar, boolean)
,
GridResourceWithFailure(String, double,
ResourceCharacteristics, ResourceCalendar, AllocPolicyWithFailure)
public GridResourceWithFailure(String name, double baud_rate, ResourceCharacteristics resource, ResourceCalendar calendar, AllocPolicyWithFailure policy) throws Exception
processOtherEvent(Sim_event)
.
name
- the name to be associated with this entity (as
required by Sim_entity class from simjava package)baud_rate
- network communication or bandwidth speedresource
- an object of ResourceCharacteristicscalendar
- an object of ResourceCalendarpolicy
- a scheduling policy for this Grid resource. If no
scheduling policy is defined, the default one is
SpaceShared
Exception
- This happens when one of the following scenarios occur:
GridSim.init(int, Calendar, boolean, String[], String[],
String)
,
GridSim.init(int, Calendar, boolean)
,
AllocPolicyWithFailure
public GridResourceWithFailure(String name, Link link, long seed, ResourceCharacteristics resource, double peakLoad, double offPeakLoad, double relativeHolidayLoad, LinkedList weekends, LinkedList holidays) throws Exception
GridResourceWithFailure(String, Link, ResourceCharacteristics,
ResourceCalendar, AllocPolicyWithFailure)
and then overrides processOtherEvent(Sim_event)
.
name
- the name to be associated with this entity (as
required by Sim_entity class from simjava package)link
- the link that will be used to connect this
GridResourceWithFailure to another Entity or Router.seed
- the initial seedresource
- an object of ResourceCharacteristicspeakLoad
- the load during peak timesoffPeakLoad
- the load during off peak timesrelativeHolidayLoad
- the load during holiday timesweekends
- a linked-list contains the weekend daysholidays
- a linked-list contains the public holidays
Exception
- This happens when one of the following scenarios occur:
GridSim.init(int, Calendar, boolean, String[], String[],
String)
public GridResourceWithFailure(String name, Link link, ResourceCharacteristics resource, ResourceCalendar calendar) throws Exception
GridResourceWithFailure(String, Link, ResourceCharacteristics,
ResourceCalendar, AllocPolicyWithFailure)
and then overrides processOtherEvent(Sim_event)
.
name
- the name to be associated with this entity (as
required by Sim_entity class from simjava package)link
- the link that will be used to connect this
GridResourceWithFailure to another Entity or Router.resource
- an object of ResourceCharacteristicscalendar
- an object of ResourceCalendar
Exception
- This happens when one of the following scenarios occur:
GridSim.init(int, Calendar, boolean, String[], String[],
String)
public GridResourceWithFailure(String name, Link link, ResourceCharacteristics resource, ResourceCalendar calendar, AllocPolicyWithFailure policy) throws Exception
processOtherEvent(Sim_event)
.
name
- the name to be associated with this entity (as
required by Sim_entity class from simjava package)link
- the link that will be used to connect this
GridResourceWithFailure to another Entity or Router.resource
- an object of ResourceCharacteristicscalendar
- an object of ResourceCalendarpolicy
- a scheduling policy for this Grid resource. If no
scheduling policy is defined, the default one is
SpaceShared
Exception
- This happens when one of the following scenarios occur:
GridSim.init(int, Calendar, boolean, String[], String[],
String)
,
AllocPolicyWithFailure
Method Detail |
---|
public boolean setRegionalGIS(String regionalGIS)
GridInformationService
or
system GIS.
regionalGIS
- name of regional GIS entity
public boolean setRegionalGIS(AbstractGIS gis)
GridInformationService
or
system GIS.
gis
- regional GIS entity object
public void setTrace(boolean trace)
trace
- true if you want to record this resource's
activities, false otherwisepublic void body()
The services or tags available for this resource are:
GridSimTags.RESOURCE_CHARACTERISTICS
GridSimTags.RESOURCE_DYNAMICS
GridSimTags.GRIDLET_SUBMIT
GridSimTags.GRIDLET_CANCEL
GridSimTags.GRIDLET_PAUSE
GridSimTags.GRIDLET_RESUME
GridSimTags.GRIDLET_MOVE
GridSimTags.GRIDLET_STATUS
registerOtherEntity()
method
processOtherEvent(Sim_event)
method
body
in class Sim_entity
protected void processOtherEvent(Sim_event ev)
body()
for incoming unknown tags.
Another approach is to override the
AllocPolicy.processOtherEvent(Sim_event)
method.
This approach is desirable if you do not want to create a new type of
grid resource.
ev
- a Sim_event objectprotected void registerOtherEntity()
body()
to register other type to
GridInformationService
entity. In doing so, you
need to create a new child class extending from
GridInformationService
.
body()
method, if
you use this method.
GridInformationService
protected void write(String event, int numMachines)
event
- Values: "Removing" or "Registering" a resourcenumMachines
- number of failed machines
|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |