|
GridSim v3.3 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectThread
eduni.simjava.Sim_entity
gridsim.GridSimCore
gridsim.GridResource
GridResource 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.
The process of creating a Grid resource is as follows:
A resource having a single machine with one or more PEs (Processing Elements) is managed as a time-shared system using a round-robin scheduling algorithm. A resource with multiple machines is treated as a distributed memory cluster and is managed as a space-shared system using FCFS (First Come Firt Serve) scheduling policy or its variants.
Since GridSim 2.2, other scheduling algorithm can be added externally (without compiling or replacing the existing GridSim JAR file) into a Grid resource. For more information, look on tutorial page or AllocPolicy class.
Since GridSim 3.0, different types of resources can be created externally without modifying this class. You need to do the following:
GridResource(String, double, ResourceCharacteristics,
ResourceCalendar, AllocPolicy)
registerOtherEntity()
method to register a
different entity or tag to GridInformationService
.
However, you also need to create a new child class extending from
GridInformationService
.
processOtherEvent(Sim_event)
method to process
other incoming tags apart from the standard ones.
body()
method if you do step 3.
Sim_entity
class.
Sim_entity
class.
Since GridSim 3.1, a network framework has been incorporated into this simulation. To make use of this, you need to create a resource entity only using the below constructors:
GridResource(String, Link, ResourceCharacteristics,
ResourceCalendar, AllocPolicy)
GridResource(String, Link, ResourceCharacteristics,
ResourceCalendar)
GridResource(String, Link, long,
ResourceCharacteristics, double, double, double,
LinkedList, LinkedList)
GridSimCore
,
ResourceCharacteristics
,
AllocPolicy
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 gridsim.GridSimCore |
input, output |
Fields inherited from class eduni.simjava.Sim_entity |
|
Fields inherited from class Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
GridResource(String name,
double baud_rate,
long seed,
ResourceCharacteristics resource,
double peakLoad,
double offPeakLoad,
double relativeHolidayLoad,
LinkedList weekends,
LinkedList holidays)
Allocates a new GridResource object. |
|
GridResource(String name,
double baud_rate,
ResourceCharacteristics resource,
ResourceCalendar calendar)
Allocates a new GridResource object. |
|
GridResource(String name,
double baud_rate,
ResourceCharacteristics resource,
ResourceCalendar calendar,
AllocPolicy policy)
Allocates a new GridResource object. |
|
GridResource(String name,
Link link,
long seed,
ResourceCharacteristics resource,
double peakLoad,
double offPeakLoad,
double relativeHolidayLoad,
LinkedList weekends,
LinkedList holidays)
Allocates a new GridResource object. |
|
GridResource(String name,
Link link,
ResourceCharacteristics resource,
ResourceCalendar calendar)
Allocates a new GridResource object. |
|
GridResource(String name,
Link link,
ResourceCharacteristics resource,
ResourceCalendar calendar,
AllocPolicy policy)
Allocates a new GridResource object. |
Method Summary | |
void |
body()
Handles external events that are coming to this GridResource 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 |
SpaceShare_AllocatePEtoGridlet(Gridlet gl)
Deprecated. As of GridSim 2.2, this method is OBSOLETE. |
void |
spaceShared_AllocatePEtoGridlet(Gridlet gl)
Deprecated. As of GridSim 2.2, this method is OBSOLETE. |
Methods inherited from class gridsim.GridSimCore |
finalize, finalizeGridSimulation, getLink, getPingResult, isNetworked, IsNetworked, ping, ping, ping, ping, pingBlockingCall, pingBlockingCall, pingBlockingCall, pingBlockingCall, send, Send, send, Send, send, Send, send, Send, send, Send, send, Send, setBackgroundTraffic, setBackgroundTraffic, TerminateInputOutputEntities, terminateIOEntities |
Methods inherited from class eduni.simjava.Sim_entity |
add_generator, add_param, add_port, clone, get_id, get_name, get_port, get_port, get_stat, run, send_on, set_invisible, set_stat, sim_cancel, sim_completed, sim_current, sim_get_next, sim_get_next, sim_hold_for, sim_hold, sim_pause_for, sim_pause_for, sim_pause_until, sim_pause_until, sim_pause, sim_process_for, sim_process_for, sim_process_until, sim_process_until, sim_process, sim_putback, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_select, sim_trace, sim_wait_for, sim_wait_for, sim_wait_for, sim_wait, sim_waiting, sim_waiting |
Methods inherited from class Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class Object |
equals, 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 GridResource(String name, double baud_rate, long seed, ResourceCharacteristics resource, double peakLoad, double offPeakLoad, double relativeHolidayLoad, LinkedList weekends, LinkedList holidays) throws Exception
GridResource(String, double, ResourceCharacteristics,
ResourceCalendar, AllocPolicy)
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)
,
GridResource(String, double,
ResourceCharacteristics, ResourceCalendar, AllocPolicy)
public GridResource(String name, double baud_rate, ResourceCharacteristics resource, ResourceCalendar calendar) throws Exception
GridResource(String, double, ResourceCharacteristics,
ResourceCalendar, AllocPolicy)
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)
,
GridResource(String, double,
ResourceCharacteristics, ResourceCalendar, AllocPolicy)
public GridResource(String name, double baud_rate, ResourceCharacteristics resource, ResourceCalendar calendar, AllocPolicy 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)
,
AllocPolicy
public GridResource(String name, Link link, long seed, ResourceCharacteristics resource, double peakLoad, double offPeakLoad, double relativeHolidayLoad, LinkedList weekends, LinkedList holidays) throws Exception
GridResource(String, Link, ResourceCharacteristics,
ResourceCalendar, AllocPolicy)
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
GridResource 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 GridResource(String name, Link link, ResourceCharacteristics resource, ResourceCalendar calendar) throws Exception
GridResource(String, Link, ResourceCharacteristics,
ResourceCalendar, AllocPolicy)
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
GridResource 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 GridResource(String name, Link link, ResourceCharacteristics resource, ResourceCalendar calendar, AllocPolicy 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
GridResource 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)
,
AllocPolicy
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 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
public void SpaceShare_AllocatePEtoGridlet(Gridlet gl)
gl
- a Gridlet to be processedpublic void spaceShared_AllocatePEtoGridlet(Gridlet gl)
gl
- a Gridlet to be processedprotected 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
|
GridSim v3.3 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |