|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectThread
eduni.simjava.Sim_entity
gridsim.GridSim
The main class of the GridSim package that must be extended by GridSim entities. It inherits event management and threaded entity features from the eduni.simjava.Sim_entity class. This class adds networking and event delivery features, which allow synchronous or asynchronous communication for service access or delivery.
All classes that extend this class must implement a method called body(), which is automatically invoked since it is expected to be responsible for simulating entity behavior.
The entities that extend this class can be instantiated with or without networked I/O ports. A networked GridSim entity gains communication capability via the objects of GridSim's I/O entity classes, gridsim.Input and gridsim.Output classes. Each I/O entity will have a unique name assuming each GridSim entity that the user creates has a unique name. For example, a resource entity with the name `Resource2', will have an input entity whose name is prefixed with `Input_', making the input entity's full name `Input_Resource2', which is expected to be unique. The I/O entities are concurrent entities, but they are visible within the GridSim entity and are able to communicate with other GridSim entities by sending messages.
This class supports methods for simulation initilization, management and flow control. The GridSim environment must be initialized to set-up the simulation environment before creating any other GridSim entities at the user level. This method also prepares the system for simulation by creating three GridSim internal entities - gridsim.GridInformationService, gridsim.GridSimShutdown,gridsim.GridStatistics. Invoking the startGridSimulation() method starts the Grid simulation. All the resource and user entities must be instantiated in between invoking the above two methods.
This class supports static methods for sending and receiving messages between entities directly or via network entities, managing and accessing handles to various GridSim core entities, and recording statistics.
Sim_entity
,
Output
,
Input
,
GridInformationService
,
GridSimShutdown
,
GridStatistics
Field Summary | |
protected Sim_port |
input
Reading data received via input port |
protected Sim_port |
output
Sending data via output port to external entities |
static GridSimRandom |
rand
A Random object. |
static Date |
SimulationStartDate
Simulation start date with respect to GMT 0. |
Fields inherited from class eduni.simjava.Sim_entity |
|
Fields inherited from class Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
GridSim(String name)
Allocates a new GridSim object without NETWORK communication channels: "input" and "output" Sim_port. |
|
GridSim(String name,
double baudRate)
Allocates a new GridSim object with NETWORK communication channels: "input" and "output" Sim_port. |
Method Summary | |
static double |
clock()
Gets the current simulation time (based on SimJava simulation clock) |
static double |
Clock()
Deprecated. As of GridSim 2.1, replaced by clock() |
protected void |
finalize()
Deprecated. As of GridSim 2.1, replaced by finalizeGridSimulation() |
protected void |
finalizeGridSimulation()
It terminates the entities of this object that manage NETWORK communication channels |
static int |
getEntityId(String entityName)
Gets the entity ID given its name |
static int |
GetEntityId(String entityName)
Deprecated. As of GridSim 2.1, replaced by getEntityId(String) |
String |
getEntityName()
Gets the name of this entity |
String |
GetEntityName()
Deprecated. As of GridSim 2.1, replaced by getEntityName() |
static String |
getEntityName(int entityID)
Gets name of the entity given its entity ID |
static String |
GetEntityName(int entityID)
Deprecated. As of GridSim 2.1, replaced by getEntityName(int) |
static int |
getGridInfoServiceEntityId()
Gets the entity ID of GridInformationService |
static LinkedList |
getGridResourceList()
Sends a request to Grid Information Service (GIS) entity to get the list of Grid resources |
static LinkedList |
GetGridResourceList()
Deprecated. As of GridSim 2.1, replaced by getGridResourceList() |
static int |
getGridSimShutdownEntityId()
Gets the entity id of GridSimShutdown |
static int |
getGridStatisticsEntityId()
Gets the entity ID of GridStatistics |
ResourceCharacteristics |
getResourceCharacteristics(int resourceID)
Gets a ResourceCharacteristics object for a given GridResource id |
ResourceCharacteristics |
GetResourceCharacteristics(int resourceID)
Deprecated. As of GridSim 2.1, replaced by getResourceCharacteristics(int) |
Accumulator |
getResourceDynamicInfo(int resourceID)
Gets the GridResource dynamic fnformation |
Accumulator |
GetResourceDynamicInformation(int resourceID)
Deprecated. As of GridSim 2.1, replaced by getResourceDynamicInfo(int) |
static Calendar |
getSimulationCalendar()
Gets the current simulation Calendar |
static Date |
getSimulationStartDate()
Gets simulation start date with respect to GMT 0. |
static Date |
GetSimulationStartDate()
Deprecated. As of GridSim 2.1, replaced by getSimulationStartDate() |
static int |
GridInformationServiceEntityId()
Deprecated. As of GridSim 2.1, replaced by getGridInfoServiceEntityId() |
protected Gridlet |
gridletCancel(Gridlet gl,
int resourceId,
double delay)
Cancels a Gridlet that is currently executing in a given GridResource ID with a delay. |
protected Gridlet |
gridletCancel(int gridletId,
int userId,
int resourceId,
double delay)
Cancels a Gridlet that is currently executing in a given GridResource ID with a delay. |
protected boolean |
gridletMove(Gridlet gl,
int srcId,
int destId,
double delay)
Moves a Gridlet to the destination GridResource ID |
protected boolean |
gridletMove(int gridletId,
int userId,
int srcId,
int destId,
double delay,
boolean ack)
Moves a Gridlet to the destination GridResource ID |
protected boolean |
gridletPause(Gridlet gl,
int resId,
double delay)
Pauses a Gridlet that is currently executing in a given GridResource ID with a delay. |
protected boolean |
gridletPause(int gridletId,
int userId,
int resourceId,
double delay,
boolean ack)
Pauses a Gridlet that is currently executing in a given GridResource ID with a delay. |
protected Gridlet |
gridletReceive()
Gets a Gridlet object passed in this event |
protected Gridlet |
GridletReceive()
Deprecated. As of GridSim 2.1, replaced by gridletReceive() |
protected boolean |
gridletResume(Gridlet gl,
int resId,
double delay)
Resumes a Gridlet that is currently pausing in a given GridResource ID with a delay. |
protected boolean |
gridletResume(int gridletId,
int userId,
int resourceId,
double delay,
boolean ack)
Resumes a Gridlet that is currently pausing in a given GridResource ID with a delay. |
protected int |
gridletStatus(Gridlet gl,
int resourceId)
Gets the current status of this Gridlet in a given GridResource ID |
protected int |
gridletStatus(int gridletId,
int userId,
int resourceId)
Gets the current status of this Gridlet in a given GridResource ID |
protected boolean |
gridletSubmit(Gridlet gl,
int resID)
Sends a Gridlet to the destination GridResource ID without any delay and without an acknowledgement. |
protected boolean |
GridletSubmit(Gridlet gl,
int resID)
Deprecated. As of GridSim 2.1, replaced by gridletSubmit(Gridlet,
int) |
protected boolean |
gridletSubmit(Gridlet gl,
int resourceID,
double delay,
boolean ack)
Sends a Gridlet to the destination GridResource ID with a specified delay. |
void |
gridSimHold(double duration)
Causes the entity to hold for duration units of simulation time |
void |
GridSimHold(double duration)
Deprecated. As of GridSim 2.1, replaced by gridSimHold(double) |
static int |
GridSimShutdownEntityId()
Deprecated. As of GridSim 2.1, replaced by getGridSimShutdownEntityId() |
static int |
GridStatisticsEntityId()
Deprecated. As of GridSim 2.1, replaced by getGridStatisticsEntityId() |
static void |
init(int numUser,
Calendar cal,
boolean traceFlag,
String[] excludeFromFile,
String[] excludeFromProcessing,
String reportWriterName)
Initializes GridSim Parameters. |
static void |
Init(int numUser,
Calendar cal,
boolean traceFlag,
String[] excludeFromFile,
String[] excludeFromProcessing,
String reportWriterName)
Deprecated. As of GridSim 2.1, replaced by init(int, Calendar, boolean, String[],
String[], String) |
boolean |
isNetworked()
Check type of entity |
boolean |
IsNetworked()
Deprecated. As of GridSim 2.1, replaced by isNetworked() |
protected Object |
receiveEventObject()
Gets the data passed in this event |
protected Object |
ReceiveEventObject()
Deprecated. As of GridSim 2.1, replaced by receiveEventObject() |
protected Object |
receiveEventObject(Sim_port sourcePort)
Gets the data passed in this event |
protected Object |
ReceiveEventObject(Sim_port sourcePort)
Gets the data passed in this event |
void |
recordStatistics(String category,
boolean data)
Records statistics during the event |
void |
RecordStatistics(String category,
boolean data)
Deprecated. As of GridSim 2.1, replaced by recordStatistics(String, boolean) |
void |
recordStatistics(String category,
double data)
Records statistics during the event |
void |
RecordStatistics(String category,
double data)
Deprecated. As of GridSim 2.1, replaced by recordStatistics(String, double) |
void |
recordStatistics(String category,
int data)
Records statistics during the event |
void |
RecordStatistics(String category,
int data)
Deprecated. As of GridSim 2.1, replaced by recordStatistics(String, int) |
void |
recordStatistics(String category,
String data)
Records statistics during the event |
void |
RecordStatistics(String category,
String data)
Deprecated. As of GridSim 2.1, replaced by recordStatistics(String, String) |
protected void |
send(int entityID,
double delay,
int gridSimTag)
Sends an event/message to another entity by delaying the simulation time from the current time, with a tag representing the event type. |
protected void |
Send(int entityID,
double delay,
int gridSimTag)
Deprecated. As of GridSim 2.1, replaced by send(int, double,
int) |
protected void |
send(int entityID,
double delay,
int gridSimTag,
Object data)
Sends an event/message to another entity by delaying the simulation time from the current time, with a tag representing the event type. |
protected void |
Send(int entityID,
double delay,
int gridSimTag,
Object data)
Deprecated. As of GridSim 2.1, replaced by send(int, double,
int, Object) |
protected void |
send(Sim_port destPort,
double delay,
int gridSimTag)
Sends an event/message to another entity by delaying the simulation time from the current time, with a tag representing the event type. |
protected void |
Send(Sim_port destPort,
double delay,
int gridSimTag)
Deprecated. As of GridSim 2.1, replaced by send(Sim_port, double,
int) |
protected void |
send(Sim_port destPort,
double delay,
int gridSimTag,
Object data)
Sends an event/message to another entity by delaying the simulation time from the current time, with a tag representing the event type. |
protected void |
Send(Sim_port destPort,
double delay,
int gridSimTag,
Object data)
Deprecated. As of GridSim 2.1, replaced by send(Sim_port, double,
int, Object) |
protected void |
send(String entityName,
double delay,
int gridSimTag)
Sends an event/message to another entity by delaying the simulation time from the current time, with a tag representing the event type. |
protected void |
Send(String entityName,
double delay,
int gridSimTag)
Deprecated. As of GridSim 2.1, replaced by send(String, double,
int) |
protected void |
send(String entityName,
double delay,
int gridSimTag,
Object data)
Sends an event/message to another entity by delaying the simulation time from the current time, with a tag representing the event type. |
protected void |
Send(String entityName,
double delay,
int gridSimTag,
Object data)
Deprecated. As of GridSim 2.1, replaced by send(String, double,
int, Object) |
protected void |
shutdownGridStatisticsEntity()
Tells the GridStatistics entity the end of the simulation |
protected void |
ShutdownGridStatisticsEntity()
Deprecated. As of GridSim 2.1, replaced by shutdownGridStatisticsEntity() |
protected void |
shutdownUserEntity()
Tells all user entities to shut down the simulation. |
protected void |
ShutdownUserEntity()
Deprecated. As of GridSim 2.1, replaced by shutdownUserEntity() |
static void |
Start()
Deprecated. As of GridSim 2.1, replaced by startGridSimulation() |
static void |
startGridSimulation()
Starts the execution of GridSim simulation. |
static void |
Stop()
Deprecated. As of GridSim 2.1, replaced by stopGridSimulation() |
static void |
stopGridSimulation()
Stops Grid Simulation (based on SimJava Sim_system.run_stop()). |
protected void |
TerminateInputOutputEntities()
Deprecated. As of GridSim 2.1, replaced by terminateIOEntities() |
protected void |
terminateIOEntities()
It terminates Entities managing NETWORK communication channels. |
Methods inherited from class eduni.simjava.Sim_entity |
add_generator, add_param, add_port, body, 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 Sim_port input
protected Sim_port output
public static Date SimulationStartDate
init(int, Calendar, boolean, String[],
String[], String)
public static GridSimRandom rand
init(int, Calendar, boolean, String[], String[], String)
Constructor Detail |
public GridSim(String name) throws Exception
name
- the name to be associated with this entity (as
required by Sim_entity class from simjava package)
Exception
- This happens when creating this entity before
initializing GridSim package or this entity name is
null or emptyinit(int, Calendar, boolean, String[], String[],
String)
,
Sim_entity
public GridSim(String name, double baudRate) throws Exception
name
- the name to be associated with this entity (as
required by Sim_entity class from simjava package)baudRate
- network communication or bandwidth speed
Exception
- This happens when creating this entity before
initializing GridSim package or this entity name is
null or emptyinit(int, Calendar, boolean, String[], String[],
String)
,
Sim_entity
,
Input
,
Output
Method Detail |
protected void TerminateInputOutputEntities()
terminateIOEntities()
GridSim(String, double)
protected void terminateIOEntities()
GridSim(String, double)
protected void finalize()
finalizeGridSimulation()
terminateIOEntities()
protected void finalizeGridSimulation()
terminateIOEntities()
public boolean IsNetworked()
isNetworked()
public boolean isNetworked()
public static Date GetSimulationStartDate()
getSimulationStartDate()
init(int, Calendar, boolean, String[], String[], String)
Date
public static Date getSimulationStartDate()
init(int, Calendar, boolean, String[], String[], String)
Date
public static Calendar getSimulationCalendar()
init(int, Calendar, boolean, String[], String[],
String)
public static void Init(int numUser, Calendar cal, boolean traceFlag, String[] excludeFromFile, String[] excludeFromProcessing, String reportWriterName)
init(int, Calendar, boolean, String[],
String[], String)
numUser
- the number of User Entities created.
This parameters indicates that
gridsim.GridSimShutdown first waits for
User Entities's END_OF_SIMULATION signal before
issuing terminate signal to other entitiescal
- the Calendar object for storing peaktime, holiday,
etctraceFlag
- true if GridSim trace need to be writtenexcludeFromFile
- an array of String containing list of files to
be excluded from statisticsexcludeFromProcessing
- an array of String containing list of
processings to be excluded from writing
into a filereportWriterName
- the name of the entities which is signaled
to write any specific report just before
termination of the simulationGridSimShutdown
public static void init(int numUser, Calendar cal, boolean traceFlag, String[] excludeFromFile, String[] excludeFromProcessing, String reportWriterName)
numUser
- the number of User Entities created.
This parameters indicates that
gridsim.GridSimShutdown first waits for
User Entities's END_OF_SIMULATION signal before
issuing terminate signal to other entitiescal
- the Calendar object for storing peaktime, holiday,
etctraceFlag
- true if GridSim trace need to be writtenexcludeFromFile
- an array of String containing list of files to
be excluded from statisticsexcludeFromProcessing
- an array of String containing list of
processings to be excluded from writing
into a filereportWriterName
- the name of the entities which is signaled
to write any specific report just before
termination of the simulationGridSimShutdown
public static void Start() throws NullPointerException
startGridSimulation()
Note: This method should be called after all the entities have been setup and added, and their ports are linked.
NullPointerException
- This happens when creating this entity
before initializing GridSim package or this entity name is
null or emptyinit(int, Calendar, boolean, String[], String[],
String)
public static void startGridSimulation() throws NullPointerException
Note: This method should be called after all the entities have been setup and added, and their ports are linked.
NullPointerException
- This happens when creating this entity
before initializing GridSim package or this entity name is
null or emptyinit(int, Calendar, boolean, String[], String[],
String)
public static double Clock()
clock()
Sim_system.clock()
public static double clock()
Sim_system.clock()
public void GridSimHold(double duration)
gridSimHold(double)
duration
- the amount of time to holdpublic void gridSimHold(double duration)
duration
- the amount of time to holdpublic static void Stop() throws NullPointerException
stopGridSimulation()
NullPointerException
- This happens when creating this entity
before initializing GridSim package or this entity name is
null or emptySim_system.run_stop()
,
init(int, Calendar, boolean, String[], String[],
String)
public static void stopGridSimulation() throws NullPointerException
NullPointerException
- This happens when creating this entity
before initializing GridSim package or this entity name is
null or emptyinit(int, Calendar, boolean, String[], String[],
String)
,
Sim_system.run_stop()
protected void Send(String entityName, double delay, int gridSimTag)
send(String, double,
int)
It is recommended to use send() method with an output port if the network bandwidth plays an important role in this simulation. However, the entity must have the network entities, i.e. Input and Output port (specified during the creation of the entity by giving a baud rate or bandwidth speed). Below is an example on how to do:
... // other code
// object is the entity or message you want to send
// size is the object size in bytes (rough estimation)
// destination id is the entity ID you want to send the object to
IO_data data = new IO_data(object, size, destinationID);
// If this entity extends from GridSim class, then you should use it
// otherwise need to create a new Sim_port object
Sim_port port = super.output;
// delay is the simulation time delay
// tag is the event type (user-defined or choose one from
GridSimTags class)
send(port, delay, tag, data);
... // remaining other code
entityName
- the name of the destination entitydelay
- how long the event/message should be delivered
from the current simulation time.
If delay is a negative number, then it will be
changed to 0.0gridSimTag
- an user-defined number representing the type of
an event/messageprotected void send(String entityName, double delay, int gridSimTag)
It is recommended to use send() method with an output port if the network bandwidth plays an important role in this simulation. However, the entity must have the network entities, i.e. Input and Output port (specified during the creation of the entity by giving a baud rate or bandwidth speed). Below is an example on how to do:
... // other code
// object is the entity or message you want to send
// size is the object size in bytes (rough estimation)
// destination id is the entity ID you want to send the object to
IO_data data = new IO_data(object, size, destinationID);
// If this entity extends from GridSim class, then you should use it
// otherwise need to create a new Sim_port object
Sim_port port = super.output;
// delay is the simulation time delay
// tag is the event type (user-defined or choose one from
GridSimTags class)
send(port, delay, tag, data);
... // remaining other code
entityName
- the name of the destination entitydelay
- how long the event/message should be delivered
from the current simulation time
If delay is a negative number, then it will be
changed to 0.0gridSimTag
- an user-defined number representing the type of
an event/messageprotected void Send(String entityName, double delay, int gridSimTag, Object data)
send(String, double,
int, Object)
It is recommended to use send() method with an output port if the network bandwidth plays an important role in this simulation. However, the entity must have the network entities, i.e. Input and Output port (specified during the creation of the entity by giving a baud rate or bandwidth speed). Below is an example on how to do:
... // other code
// object is the entity or message you want to send
// size is the object size in bytes (rough estimation)
// destination id is the entity ID you want to send the object to
IO_data data = new IO_data(object, size, destinationID);
// If this entity extends from GridSim class, then you should use it
// otherwise need to create a new Sim_port object
Sim_port port = super.output;
// delay is the simulation time delay
// tag is the event type (user-defined or choose one from
GridSimTags class)
send(port, delay, tag, data);
... // remaining other code
entityName
- the name of the destination entitydelay
- how long the event/message should be delivered
from the current simulation time
If delay is a negative number, then it will be
changed to 0.0gridSimTag
- an user-defined number representing the type of
an event/messagedata
- A reference to data to be sent with the eventprotected void send(String entityName, double delay, int gridSimTag, Object data)
It is recommended to use send() method with an output port if the network bandwidth plays an important role in this simulation. However, the entity must have the network entities, i.e. Input and Output port (specified during the creation of the entity by giving a baud rate or bandwidth speed). Below is an example on how to do:
... // other code
// object is the entity or message you want to send
// size is the object size in bytes (rough estimation)
// destination id is the entity ID you want to send the object to
IO_data data = new IO_data(object, size, destinationID);
// If this entity extends from GridSim class, then you should use it
// otherwise need to create a new Sim_port object
Sim_port port = super.output;
// delay is the simulation time delay
// tag is the event type (user-defined or choose one from
GridSimTags class)
send(port, delay, tag, data);
... // remaining other code
entityName
- the name of the destination entitydelay
- how long the event/message should be delivered
from the current simulation time
If delay is a negative number, then it will be
changed to 0.0gridSimTag
- an user-defined number representing the type of
an event/messagedata
- A reference to data to be sent with the eventprotected void Send(int entityID, double delay, int gridSimTag)
send(int, double,
int)
It is recommended to use send() method with an output port if the network bandwidth plays an important role in this simulation. However, the entity must have the network entities, i.e. Input and Output port (specified during the creation of the entity by giving a baud rate or bandwidth speed). Below is an example on how to do:
... // other code
// object is the entity or message you want to send
// size is the object size in bytes (rough estimation)
// destination id is the entity ID you want to send the object to
IO_data data = new IO_data(object, size, destinationID);
// If this entity extends from GridSim class, then you should use it
// otherwise need to create a new Sim_port object
Sim_port port = super.output;
// delay is the simulation time delay
// tag is the event type (user-defined or choose one from
GridSimTags class)
send(port, delay, tag, data);
... // remaining other code
entityID
- the id number of the destination entitydelay
- how long the event/message should be delivered
from the current simulation time
If delay is a negative number, then it will be
changed to 0.0gridSimTag
- an user-defined number representing the type of
an event/messageprotected void send(int entityID, double delay, int gridSimTag)
It is recommended to use send() method with an output port if the network bandwidth plays an important role in this simulation. However, the entity must have the network entities, i.e. Input and Output port (specified during the creation of the entity by giving a baud rate or bandwidth speed). Below is an example on how to do:
... // other code
// object is the entity or message you want to send
// size is the object size in bytes (rough estimation)
// destination id is the entity ID you want to send the object to
IO_data data = new IO_data(object, size, destinationID);
// If this entity extends from GridSim class, then you should use it
// otherwise need to create a new Sim_port object
Sim_port port = super.output;
// delay is the simulation time delay
// tag is the event type (user-defined or choose one from
GridSimTags class)
send(port, delay, tag, data);
... // remaining other code
entityID
- the id number of the destination entitydelay
- how long the event/message should be delivered
from the current simulation time
If delay is a negative number, then it will be
changed to 0.0gridSimTag
- an user-defined number representing the type of
an event/messageprotected void Send(int entityID, double delay, int gridSimTag, Object data)
send(int, double,
int, Object)
It is recommended to use send() method with an output port if the network bandwidth plays an important role in this simulation. However, the entity must have the network entities, i.e. Input and Output port (specified during the creation of the entity by giving a baud rate or bandwidth speed). Below is an example on how to do:
... // other code
// object is the entity or message you want to send
// size is the object size in bytes (rough estimation)
// destination id is the entity ID you want to send the object to
IO_data data = new IO_data(object, size, destinationID);
// If this entity extends from GridSim class, then you should use it
// otherwise need to create a new Sim_port object
Sim_port port = super.output;
// delay is the simulation time delay
// tag is the event type (user-defined or choose one from
GridSimTags class)
send(port, delay, tag, data);
... // remaining other code
entityID
- the id number of the destination entitydelay
- how long the event/message should be delivered
from the current simulation time
If delay is a negative number, then it will be
changed to 0.0gridSimTag
- an user-defined number representing the type of
an event/messagedata
- A reference to data to be sent with the eventprotected void send(int entityID, double delay, int gridSimTag, Object data)
It is recommended to use send() method with an output port if the network bandwidth plays an important role in this simulation. However, the entity must have the network entities, i.e. Input and Output port (specified during the creation of the entity by giving a baud rate or bandwidth speed). Below is an example on how to do:
... // other code
// object is the entity or message you want to send
// size is the object size in bytes (rough estimation)
// destination id is the entity ID you want to send the object to
IO_data data = new IO_data(object, size, destinationID);
// If this entity extends from GridSim class, then you should use it
// otherwise need to create a new Sim_port object
Sim_port port = super.output;
// delay is the simulation time delay
// tag is the event type (user-defined or choose one from
GridSimTags class)
send(port, delay, tag, data);
... // remaining other code
entityID
- the id number of the destination entitydelay
- how long the event/message should be delivered
from the current simulation time
If delay is a negative number, then it will be
changed to 0.0gridSimTag
- an user-defined number representing the type of
an event/messagedata
- A reference to data to be sent with the eventprotected void Send(Sim_port destPort, double delay, int gridSimTag)
send(Sim_port, double,
int)
It is recommended to use send() method with an output port if the network bandwidth plays an important role in this simulation. However, the entity must have the network entities, i.e. Input and Output port (specified during the creation of the entity by giving a baud rate or bandwidth speed). Below is an example on how to do:
... // other code
// object is the entity or message you want to send
// size is the object size in bytes (rough estimation)
// destination id is the entity ID you want to send the object to
IO_data data = new IO_data(object, size, destinationID);
// If this entity extends from GridSim class, then you should use it
// otherwise need to create a new Sim_port object
Sim_port port = super.output;
// delay is the simulation time delay
// tag is the event type (user-defined or choose one from
GridSimTags class)
send(port, delay, tag, data);
... // remaining other code
destPort
- A reference to the port to send the event out ofdelay
- how long the event/message should be delivered
from the current simulation time
If delay is a negative number, then it will be
changed to 0.0gridSimTag
- an user-defined number representing the type of
an event/messageprotected void send(Sim_port destPort, double delay, int gridSimTag)
It is recommended to use send() method with an output port if the network bandwidth plays an important role in this simulation. However, the entity must have the network entities, i.e. Input and Output port (specified during the creation of the entity by giving a baud rate or bandwidth speed). Below is an example on how to do:
... // other code
// object is the entity or message you want to send
// size is the object size in bytes (rough estimation)
// destination id is the entity ID you want to send the object to
IO_data data = new IO_data(object, size, destinationID);
// If this entity extends from GridSim class, then you should use it
// otherwise need to create a new Sim_port object
Sim_port port = super.output;
// delay is the simulation time delay
// tag is the event type (user-defined or choose one from
GridSimTags class)
send(port, delay, tag, data);
... // remaining other code
destPort
- A reference to the port to send the event out ofdelay
- how long the event/message should be delivered
from the current simulation time
If delay is a negative number, then it will be
changed to 0.0gridSimTag
- an user-defined number representing the type of
an event/messageprotected void Send(Sim_port destPort, double delay, int gridSimTag, Object data)
send(Sim_port, double,
int, Object)
It is recommended to use send() method with an output port if the network bandwidth plays an important role in this simulation. However, the entity must have the network entities, i.e. Input and Output port (specified during the creation of the entity by giving a baud rate or bandwidth speed). Below is an example on how to do:
... // other code
// object is the entity or message you want to send
// size is the object size in bytes (rough estimation)
// destination id is the entity ID you want to send the object to
IO_data data = new IO_data(object, size, destinationID);
// If this entity extends from GridSim class, then you should use it
// otherwise need to create a new Sim_port object
Sim_port port = super.output;
// delay is the simulation time delay
// tag is the event type (user-defined or choose one from
GridSimTags class)
send(port, delay, tag, data);
... // remaining other code
destPort
- A reference to the port to send the event out ofdelay
- how long the event/message should be delivered
from the current simulation time
If delay is a negative number, then it will be
changed to 0.0gridSimTag
- an user-defined number representing the type of
an event/messagedata
- A reference to data to be sent with the eventprotected void send(Sim_port destPort, double delay, int gridSimTag, Object data)
It is recommended to use send() method with an output port if the network bandwidth plays an important role in this simulation. However, the entity must have the network entities, i.e. Input and Output port (specified during the creation of the entity by giving a baud rate or bandwidth speed). Below is an example on how to do:
... // other code
// object is the entity or message you want to send
// size is the object size in bytes (rough estimation)
// destination id is the entity ID you want to send the object to
IO_data data = new IO_data(object, size, destinationID);
// If this entity extends from GridSim class, then you should use it
// otherwise need to create a new Sim_port object
Sim_port port = super.output;
// delay is the simulation time delay
// tag is the event type (user-defined or choose one from
GridSimTags class)
send(port, delay, tag, data);
... // remaining other code
destPort
- A reference to the port to send the event out ofdelay
- how long the event/message should be delivered
from the current simulation time
If delay is a negative number, then it will be
changed to 0.0gridSimTag
- an user-defined number representing the type of
an event/messagedata
- A reference to data to be sent with the eventprotected Object ReceiveEventObject()
receiveEventObject()
protected Object receiveEventObject()
protected Object ReceiveEventObject(Sim_port sourcePort)
sourcePort
- a Sim_port object which is used to connect entities
for event passing
Sim_port
protected Object receiveEventObject(Sim_port sourcePort)
sourcePort
- a Sim_port object which is used to connect entities
for event passing
Sim_port
protected boolean GridletSubmit(Gridlet gl, int resID)
gridletSubmit(Gridlet,
int)
gl
- a Gridlet object to be sentresID
- an unique resource ID
protected boolean gridletSubmit(Gridlet gl, int resID)
gl
- a Gridlet object to be sentresID
- an unique resource ID
protected boolean gridletSubmit(Gridlet gl, int resourceID, double delay, boolean ack)
gl
- a Gridlet object to be sentresourceID
- an unique resource IDdelay
- delay time or 0.0 if want to execute NOWack
- an acknowledgment status. true if want to
know the result of this method, false
otherwise or don't care.
protected Gridlet GridletReceive()
gridletReceive()
protected Gridlet gridletReceive()
protected Gridlet gridletCancel(Gridlet gl, int resourceId, double delay)
gl
- a Gridlet object to be canceledresourceId
- an unique resource IDdelay
- delay time or 0.0 if want to cancel NOW
protected Gridlet gridletCancel(int gridletId, int userId, int resourceId, double delay)
gridletId
- a Gridlet IDuserId
- the user or owner ID of this GridletresourceId
- an unique resource ID to which this Gridlet was
previously sent todelay
- delay time or 0.0 if want to cancel NOW
protected boolean gridletPause(Gridlet gl, int resId, double delay)
gl
- a Gridlet object to be sentresId
- an unique resource IDdelay
- delay time or 0.0 if want to execute NOW
gridletReceive()
protected boolean gridletPause(int gridletId, int userId, int resourceId, double delay, boolean ack)
gridletId
- a Gridlet IDuserId
- the user or owner ID of this GridletresourceId
- an unique resource IDdelay
- delay time or 0.0 if want to execute NOWack
- an acknowledgement, i.e. true if wanted to know
whether this operation is success or not, false
otherwise (don't care)
gridletReceive()
protected int gridletStatus(Gridlet gl, int resourceId)
gl
- a Gridlet objectresourceId
- a GridResource ID that executes this Gridlet object
GridSimTags
protected int gridletStatus(int gridletId, int userId, int resourceId)
gridletId
- a Gridlet IDuserId
- the user or owner of this Gridlet objectresourceId
- a GridResource ID that executes this Gridlet object
GridSimTags
protected boolean gridletResume(Gridlet gl, int resId, double delay)
gl
- a Gridlet object to be sentresId
- an unique resource IDdelay
- delay time or 0.0 if want to execute NOW
protected boolean gridletResume(int gridletId, int userId, int resourceId, double delay, boolean ack)
gridletId
- a Gridlet IDuserId
- the user or owner ID of this GridletresourceId
- an unique resource IDdelay
- delay time or 0.0 if want to execute NOWack
- an acknowledgement, i.e. true if wanted to know
whether this operation is success or not, false
otherwise (don't care)
protected boolean gridletMove(Gridlet gl, int srcId, int destId, double delay)
gl
- a Gridlet objectsrcId
- the GridResource ID that is currently executing this GridletdestId
- the new GridResource IDdelay
- simulation delay
gridletReceive()
protected boolean gridletMove(int gridletId, int userId, int srcId, int destId, double delay, boolean ack)
gridletId
- a Gridlet IDuserId
- the owner or user ID of this GridletsrcId
- the GridResource ID that is currently executing this
GridletdestId
- the new GridResource IDdelay
- simulation delayack
- an acknowledgement, i.e. true if wanted to know
whether this operation is success or not, false
otherwise (don't care)
gridletReceive()
public String GetEntityName()
getEntityName()
public String getEntityName()
public static String GetEntityName(int entityID)
getEntityName(int)
entityID
- the entity ID
public static String getEntityName(int entityID)
entityID
- the entity ID
public static int GetEntityId(String entityName)
getEntityId(String)
entityName
- an Entity name
public static int getEntityId(String entityName)
entityName
- an Entity name
public static int GridStatisticsEntityId()
getGridStatisticsEntityId()
public static int getGridStatisticsEntityId()
public static int GridInformationServiceEntityId()
getGridInfoServiceEntityId()
public static int getGridInfoServiceEntityId()
public static int GridSimShutdownEntityId()
getGridSimShutdownEntityId()
public static int getGridSimShutdownEntityId()
protected void ShutdownUserEntity()
shutdownUserEntity()
GridSimShutdown
protected void shutdownUserEntity()
GridSimShutdown
protected void ShutdownGridStatisticsEntity()
shutdownGridStatisticsEntity()
protected void shutdownGridStatisticsEntity()
public static LinkedList GetGridResourceList()
getGridResourceList()
public static LinkedList getGridResourceList()
public ResourceCharacteristics GetResourceCharacteristics(int resourceID)
getResourceCharacteristics(int)
resourceID
- the resource ID
ResourceCharacteristics
public ResourceCharacteristics getResourceCharacteristics(int resourceID)
resourceID
- the resource ID
ResourceCharacteristics
public Accumulator GetResourceDynamicInformation(int resourceID)
getResourceDynamicInfo(int)
resourceID
- the resource ID
public Accumulator getResourceDynamicInfo(int resourceID)
resourceID
- the resource ID
public void RecordStatistics(String category, double data)
recordStatistics(String, double)
category
- a category namedata
- a value to be recordedpublic void recordStatistics(String category, double data)
category
- a category namedata
- a value to be recordedpublic void RecordStatistics(String category, int data)
recordStatistics(String, int)
category
- a category namedata
- a value to be recordedpublic void recordStatistics(String category, int data)
category
- a category namedata
- a value to be recordedpublic void RecordStatistics(String category, String data)
recordStatistics(String, String)
category
- a category namedata
- a value to be recordedpublic void recordStatistics(String category, String data)
category
- a category namedata
- a value to be recordedpublic void RecordStatistics(String category, boolean data)
recordStatistics(String, boolean)
category
- a category namedata
- a value to be recordedpublic void recordStatistics(String category, boolean data)
category
- a category namedata
- a value to be recorded
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |