gridsim
Class GridSim

Object
  extended byThread
      extended byeduni.simjava.Sim_entity
          extended bygridsim.GridSim
All Implemented Interfaces:
Cloneable, Runnable
Direct Known Subclasses:
Broker, GridInformationService, GridResource, GridSimShutdown, GridStatistics, ReportWriter, UserEntity

public class GridSim
extends Sim_entity

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.

Version:
2.2, December 2003
Author:
Manzur Murshed and Rajkumar Buyya
See Also:
Sim_entity, Output, Input, GridInformationService, GridSimShutdown, GridStatistics
Invariant:
$none

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

input

protected Sim_port input
Reading data received via input port


output

protected Sim_port output
Sending data via output port to external entities


SimulationStartDate

public static Date SimulationStartDate
Simulation start date with respect to GMT 0. This object is initialized during the call to init(int, Calendar, boolean, String[], String[], String)


rand

public static GridSimRandom rand
A Random object. This object is initialized during the call to init(int, Calendar, boolean, String[], String[], String)

Constructor Detail

GridSim

public GridSim(String name)
        throws Exception
Allocates a new GridSim object without NETWORK communication channels: "input" and "output" Sim_port. In summary, this object has NO network communication or bandwidth speed.

Parameters:
name - the name to be associated with this entity (as required by Sim_entity class from simjava package)
Throws:
Exception - This happens when creating this entity before initializing GridSim package or this entity name is null or empty
See Also:
init(int, Calendar, boolean, String[], String[], String), Sim_entity
Pre Condition:
name != null
Post Condition:
$none

GridSim

public GridSim(String name,
               double baudRate)
        throws Exception
Allocates a new GridSim object with NETWORK communication channels: "input" and "output" Sim_port. In addition, this method will create Input and Output object.

Parameters:
name - the name to be associated with this entity (as required by Sim_entity class from simjava package)
baudRate - network communication or bandwidth speed
Throws:
Exception - This happens when creating this entity before initializing GridSim package or this entity name is null or empty
See Also:
init(int, Calendar, boolean, String[], String[], String), Sim_entity, Input, Output
Pre Condition:
name != null, baudRate > 0.0
Post Condition:
$none
Method Detail

TerminateInputOutputEntities

protected void TerminateInputOutputEntities()
Deprecated. As of GridSim 2.1, replaced by terminateIOEntities()

It terminates Entities managing NETWORK communication channels. It can be invoked explicity to shutdown NETWORK communication channels. It is advisable for all entities extending GridSim class, explicitly invoke this method to terminate Input and Output entities created by the constructor: GridSim(String, double)

Pre Condition:
$none
Post Condition:
$none

terminateIOEntities

protected void terminateIOEntities()
It terminates Entities managing NETWORK communication channels. It can be invoked explicity to shutdown NETWORK communication channels. It is advisable for all entities extending GridSim class, explicitly invoke this method to terminate Input and Output entities created by the constructor: GridSim(String, double)

Pre Condition:
$none
Post Condition:
$none

finalize

protected void finalize()
Deprecated. As of GridSim 2.1, replaced by finalizeGridSimulation()

It terminates the entities of this object that manage NETWORK communication channels

See Also:
terminateIOEntities()
Pre Condition:
$none
Post Condition:
$none

finalizeGridSimulation

protected void finalizeGridSimulation()
It terminates the entities of this object that manage NETWORK communication channels

See Also:
terminateIOEntities()
Pre Condition:
$none
Post Condition:
$none

IsNetworked

public boolean IsNetworked()
Deprecated. As of GridSim 2.1, replaced by isNetworked()

Check type of entity

Returns:
true if entity has NETWORK communication channel, otherwise it returns false
Pre Condition:
$none
Post Condition:
$result == true || false

isNetworked

public boolean isNetworked()
Check type of entity

Returns:
true if entity has NETWORK communication channel, otherwise it returns false
Pre Condition:
$none
Post Condition:
$result == true || false

GetSimulationStartDate

public static Date GetSimulationStartDate()
Deprecated. As of GridSim 2.1, replaced by getSimulationStartDate()

Gets simulation start date with respect to GMT 0. If the return object is null, then need to initialize it by calling init(int, Calendar, boolean, String[], String[], String)

Returns:
an object of Date or null if it is empty
See Also:
Date
Pre Condition:
$none
Post Condition:
$none

getSimulationStartDate

public static Date getSimulationStartDate()
Gets simulation start date with respect to GMT 0. If the return object is null, then need to initialize it by calling init(int, Calendar, boolean, String[], String[], String)

Returns:
an object of Date
See Also:
Date
Pre Condition:
$none
Post Condition:
$none

getSimulationCalendar

public static Calendar getSimulationCalendar()
Gets the current simulation Calendar

Returns:
a Calendar object or null if GridSim hasn't been initialized
See Also:
init(int, Calendar, boolean, String[], String[], String)
Pre Condition:
$none
Post Condition:
$none

Init

public 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)

Initializes GridSim Parameters. This should be called before creating any entities.

Parameters:
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 entities
cal - the Calendar object for storing peaktime, holiday, etc
traceFlag - true if GridSim trace need to be written
excludeFromFile - an array of String containing list of files to be excluded from statistics
excludeFromProcessing - an array of String containing list of processings to be excluded from writing into a file
reportWriterName - the name of the entities which is signaled to write any specific report just before termination of the simulation
See Also:
GridSimShutdown
Pre Condition:
numUser >= 0
Post Condition:
$none

init

public static void init(int numUser,
                        Calendar cal,
                        boolean traceFlag,
                        String[] excludeFromFile,
                        String[] excludeFromProcessing,
                        String reportWriterName)
Initializes GridSim Parameters. This should be called before creating any entities.

Parameters:
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 entities
cal - the Calendar object for storing peaktime, holiday, etc
traceFlag - true if GridSim trace need to be written
excludeFromFile - an array of String containing list of files to be excluded from statistics
excludeFromProcessing - an array of String containing list of processings to be excluded from writing into a file
reportWriterName - the name of the entities which is signaled to write any specific report just before termination of the simulation
See Also:
GridSimShutdown
Pre Condition:
numUser >= 0
Post Condition:
$none

Start

public static void Start()
                  throws NullPointerException
Deprecated. As of GridSim 2.1, replaced by startGridSimulation()

Starts the execution of GridSim simulation. It waits for complete execution of all entitities, i.e. until all entities threads reach non-RUNNABLE state by exiting from the body() method. Then, it kills threads of all entities.

Note: This method should be called after all the entities have been setup and added, and their ports are linked.

Throws:
NullPointerException - This happens when creating this entity before initializing GridSim package or this entity name is null or empty
See Also:
init(int, Calendar, boolean, String[], String[], String)
Pre Condition:
$none
Post Condition:
$none

startGridSimulation

public static void startGridSimulation()
                                throws NullPointerException
Starts the execution of GridSim simulation. It waits for complete execution of all entitities, i.e. until all entities threads reach non-RUNNABLE state by exiting from the body() method. Then, it kills threads of all entities.

Note: This method should be called after all the entities have been setup and added, and their ports are linked.

Throws:
NullPointerException - This happens when creating this entity before initializing GridSim package or this entity name is null or empty
See Also:
init(int, Calendar, boolean, String[], String[], String)
Pre Condition:
$none
Post Condition:
$none

Clock

public static double Clock()
Deprecated. As of GridSim 2.1, replaced by clock()

Gets the current simulation time (based on SimJava simulation clock)

Returns:
The current simulation time from the simulation clock
See Also:
Sim_system.clock()
Pre Condition:
$none
Post Condition:
$result >= 0.0

clock

public static double clock()
Gets the current simulation time (based on SimJava simulation clock)

Returns:
The current simulation time from the simulation clock
See Also:
Sim_system.clock()
Pre Condition:
$none
Post Condition:
$result >= 0.0

GridSimHold

public void GridSimHold(double duration)
Deprecated. As of GridSim 2.1, replaced by gridSimHold(double)

Causes the entity to hold for duration units of simulation time

Parameters:
duration - the amount of time to hold
Pre Condition:
$none
Post Condition:
$none

gridSimHold

public void gridSimHold(double duration)
Causes the entity to hold for duration units of simulation time

Parameters:
duration - the amount of time to hold
Pre Condition:
$none
Post Condition:
$none

Stop

public static void Stop()
                 throws NullPointerException
Deprecated. As of GridSim 2.1, replaced by stopGridSimulation()

Stops Grid Simulation (based on SimJava Sim_system.run_stop()). This should be ony called if any of the user defined entities explicitly want to terminate simulation during execution.

Throws:
NullPointerException - This happens when creating this entity before initializing GridSim package or this entity name is null or empty
See Also:
Sim_system.run_stop(), init(int, Calendar, boolean, String[], String[], String)
Pre Condition:
$none
Post Condition:
$none

stopGridSimulation

public static void stopGridSimulation()
                               throws NullPointerException
Stops Grid Simulation (based on SimJava Sim_system.run_stop()). This should be ony called if any of the user defined entities explicitly want to terminate simulation during execution.

Throws:
NullPointerException - This happens when creating this entity before initializing GridSim package or this entity name is null or empty
See Also:
init(int, Calendar, boolean, String[], String[], String), Sim_system.run_stop()
Pre Condition:
$none
Post Condition:
$none

Send

protected void Send(String entityName,
                    double delay,
                    int gridSimTag)
Deprecated. As of GridSim 2.1, replaced by send(String, double, int)

Sends an event/message to another entity by delaying the simulation time from the current time, with a tag representing the event type.

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

Parameters:
entityName - the name of the destination entity
delay - 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.0
gridSimTag - an user-defined number representing the type of an event/message
Pre Condition:
entityName != null, delay >= 0.0
Post Condition:
$none

send

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.

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

Parameters:
entityName - the name of the destination entity
delay - 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.0
gridSimTag - an user-defined number representing the type of an event/message
Pre Condition:
entityName != null, delay >= 0.0
Post Condition:
$none

Send

protected void Send(String entityName,
                    double delay,
                    int gridSimTag,
                    Object data)
Deprecated. As of GridSim 2.1, replaced by send(String, double, int, Object)

Sends an event/message to another entity by delaying the simulation time from the current time, with a tag representing the event type.

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

Parameters:
entityName - the name of the destination entity
delay - 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.0
gridSimTag - an user-defined number representing the type of an event/message
data - A reference to data to be sent with the event
Pre Condition:
entityName != null, delay >= 0.0, data != null
Post Condition:
$none

send

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.

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

Parameters:
entityName - the name of the destination entity
delay - 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.0
gridSimTag - an user-defined number representing the type of an event/message
data - A reference to data to be sent with the event
Pre Condition:
entityName != null, delay >= 0.0, data != null
Post Condition:
$none

Send

protected void Send(int entityID,
                    double delay,
                    int gridSimTag)
Deprecated. As of GridSim 2.1, replaced by send(int, double, int)

Sends an event/message to another entity by delaying the simulation time from the current time, with a tag representing the event type.

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

Parameters:
entityID - the id number of the destination entity
delay - 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.0
gridSimTag - an user-defined number representing the type of an event/message
Pre Condition:
entityID > 0, delay >= 0.0
Post Condition:
$none

send

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.

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

Parameters:
entityID - the id number of the destination entity
delay - 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.0
gridSimTag - an user-defined number representing the type of an event/message
Pre Condition:
entityID > 0, delay >= 0.0
Post Condition:
$none

Send

protected void Send(int entityID,
                    double delay,
                    int gridSimTag,
                    Object data)
Deprecated. As of GridSim 2.1, replaced by send(int, double, int, Object)

Sends an event/message to another entity by delaying the simulation time from the current time, with a tag representing the event type.

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

Parameters:
entityID - the id number of the destination entity
delay - 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.0
gridSimTag - an user-defined number representing the type of an event/message
data - A reference to data to be sent with the event
Pre Condition:
entityID > 0, delay >= 0.0, data != null
Post Condition:
$none

send

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.

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

Parameters:
entityID - the id number of the destination entity
delay - 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.0
gridSimTag - an user-defined number representing the type of an event/message
data - A reference to data to be sent with the event
Pre Condition:
entityID > 0, delay >= 0.0, data != null
Post Condition:
$none

Send

protected void Send(Sim_port destPort,
                    double delay,
                    int gridSimTag)
Deprecated. As of GridSim 2.1, replaced by send(Sim_port, double, int)

Sends an event/message to another entity by delaying the simulation time from the current time, with a tag representing the event type.

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

Parameters:
destPort - A reference to the port to send the event out of
delay - 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.0
gridSimTag - an user-defined number representing the type of an event/message
Pre Condition:
destPort != null, delay >= 0.0
Post Condition:
$none

send

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.

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

Parameters:
destPort - A reference to the port to send the event out of
delay - 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.0
gridSimTag - an user-defined number representing the type of an event/message
Pre Condition:
destPort != null, delay >= 0.0
Post Condition:
$none

Send

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)

Sends an event/message to another entity by delaying the simulation time from the current time, with a tag representing the event type.

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

Parameters:
destPort - A reference to the port to send the event out of
delay - 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.0
gridSimTag - an user-defined number representing the type of an event/message
data - A reference to data to be sent with the event
Pre Condition:
destPort != null, delay >= 0.0, data != null
Post Condition:
$none

send

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.

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

Parameters:
destPort - A reference to the port to send the event out of
delay - 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.0
gridSimTag - an user-defined number representing the type of an event/message
data - A reference to data to be sent with the event
Pre Condition:
destPort != null, delay >= 0.0, data != null
Post Condition:
$none

ReceiveEventObject

protected Object ReceiveEventObject()
Deprecated. As of GridSim 2.1, replaced by receiveEventObject()

Gets the data passed in this event

Returns:
A reference to the data
Pre Condition:
$none
Post Condition:
$result != null

receiveEventObject

protected Object receiveEventObject()
Gets the data passed in this event

Returns:
A reference to the data
Pre Condition:
$none
Post Condition:
$result != null

ReceiveEventObject

protected Object ReceiveEventObject(Sim_port sourcePort)
Gets the data passed in this event

Parameters:
sourcePort - a Sim_port object which is used to connect entities for event passing
Returns:
A reference to the data or null if the source port is empty
See Also:
Sim_port
Pre Condition:
sourcePort != null
Post Condition:
$none

receiveEventObject

protected Object receiveEventObject(Sim_port sourcePort)
Gets the data passed in this event

Parameters:
sourcePort - a Sim_port object which is used to connect entities for event passing
Returns:
A reference to the data or null if the source port is empty
See Also:
Sim_port
Pre Condition:
sourcePort != null
Post Condition:
$none

GridletSubmit

protected boolean GridletSubmit(Gridlet gl,
                                int resID)
Deprecated. As of GridSim 2.1, replaced by gridletSubmit(Gridlet, int)

Sends a Gridlet to the destination GridResource ID without any delay and without an acknowledgement.

Parameters:
gl - a Gridlet object to be sent
resID - an unique resource ID
Returns:
true if this Gridlet has been submitted to the destination GridResource, false otherwise. Submitting a Gridlet can be failed for the one or more following reasons:
  • if a GridResource ID doesn't exist
  • if a Gridlet ID doesn't exist
  • if a Gridlet's user ID doesn't exist
  • if a Gridlet object is null or empty;
  • if a Gridlet object has finished executing beforehand
Pre Condition:
gl != null, resID >= 0
Post Condition:
$none

gridletSubmit

protected boolean gridletSubmit(Gridlet gl,
                                int resID)
Sends a Gridlet to the destination GridResource ID without any delay and without an acknowledgement.

Parameters:
gl - a Gridlet object to be sent
resID - an unique resource ID
Returns:
true if this Gridlet has been submitted to the destination GridResource, false otherwise. Submitting a Gridlet can be failed for the one or more following reasons:
  • if a GridResource ID doesn't exist
  • if a Gridlet ID doesn't exist
  • if a Gridlet's user ID doesn't exist
  • if a Gridlet object is null or empty;
  • if a Gridlet object has finished executing beforehand
Pre Condition:
gl != null, resID >= 0
Post Condition:
$none

gridletSubmit

protected boolean gridletSubmit(Gridlet gl,
                                int resourceID,
                                double delay,
                                boolean ack)
Sends a Gridlet to the destination GridResource ID with a specified delay.

Parameters:
gl - a Gridlet object to be sent
resourceID - an unique resource ID
delay - delay time or 0.0 if want to execute NOW
ack - an acknowledgment status. true if want to know the result of this method, false otherwise or don't care.
Returns:
true if this Gridlet has been submitted to the destination GridResource, false otherwise. Submitting a Gridlet can be failed for the one or more following reasons:
  • if the acknowledgment status in the parameter of this method is set to false
  • if a GridResource ID doesn't exist
  • if a Gridlet ID doesn't exist
  • if a Gridlet's user ID doesn't exist
  • if the delay time is negative
  • if a Gridlet object is null or empty;
  • if a Gridlet object has finished executing beforehand
Pre Condition:
gl != null, resourceID >= 0, delay >= 0.0
Post Condition:
$none

GridletReceive

protected Gridlet GridletReceive()
Deprecated. As of GridSim 2.1, replaced by gridletReceive()

Gets a Gridlet object passed in this event

Returns:
A reference to Gridlet object
Pre Condition:
$none
Post Condition:
$result != null

gridletReceive

protected Gridlet gridletReceive()
Gets a Gridlet object passed in this event

Returns:
A reference to Gridlet object
Pre Condition:
$none
Post Condition:
$result != null

gridletCancel

protected Gridlet gridletCancel(Gridlet gl,
                                int resourceId,
                                double delay)
Cancels a Gridlet that is currently executing in a given GridResource ID with a delay.
NOTE: Canceling a Gridlet operation can take a long time over a slow network if the Gridlet size is big.

Parameters:
gl - a Gridlet object to be canceled
resourceId - an unique resource ID
delay - delay time or 0.0 if want to cancel NOW
Returns:
the canceled Gridlet or nullfinished in time of cancellation, then this method will return the finished Gridlet. Canceling a Gridlet can be failed for the one or more following reasons:
  • if a GridResource ID doesn't exist
  • if a Gridlet ID doesn't exist
  • if a Gridlet's user ID doesn't exist
  • if the delay time is negative
  • if a Gridlet object is null or empty;
Pre Condition:
gl != null, resourceId >= 0, delay >= 0.0
Post Condition:
$none

gridletCancel

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.
NOTE: Canceling a Gridlet operation can be slow over a slow network if the Gridlet size is big.

Parameters:
gridletId - a Gridlet ID
userId - the user or owner ID of this Gridlet
resourceId - an unique resource ID to which this Gridlet was previously sent to
delay - delay time or 0.0 if want to cancel NOW
Returns:
the canceled Gridlet or nullfinished in time of cancellation, then this method will return the finished Gridlet. Canceling a Gridlet can be failed for the one or more following reasons:
  • if a GridResource ID doesn't exist
  • if a Gridlet ID doesn't exist
  • if a Gridlet's user ID doesn't exist
  • if the delay time is negative
Pre Condition:
gridletId >= 0, userId >= 0, resourceId >= 0, delay >= 0.0
Post Condition:
$none

gridletPause

protected boolean gridletPause(Gridlet gl,
                               int resId,
                               double delay)
Pauses a Gridlet that is currently executing in a given GridResource ID with a delay.

Parameters:
gl - a Gridlet object to be sent
resId - an unique resource ID
delay - delay time or 0.0 if want to execute NOW
Returns:
true if this Gridlet has been paused successfully in the destination GridResource, false otherwise. Pausing a Gridlet can be failed for the one or more following reasons:
  • if a GridResource ID doesn't exist
  • if a Gridlet ID doesn't exist
  • if a Gridlet's user ID doesn't exist
  • if the delay time is negative
  • if a Gridlet object is null or empty;
  • if a Gridlet object has finished executing beforehand. The Gridlet needs to be retrieved by using gridletReceive()
Pre Condition:
gl != null, resId >= 0, delay >= 0.0
Post Condition:
$none

gridletPause

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.

Parameters:
gridletId - a Gridlet ID
userId - the user or owner ID of this Gridlet
resourceId - an unique resource ID
delay - delay time or 0.0 if want to execute NOW
ack - an acknowledgement, i.e. true if wanted to know whether this operation is success or not, false otherwise (don't care)
Returns:
true if this Gridlet has been paused successfully in the destination GridResource, false otherwise. Pausing a Gridlet can be failed for the one or more following reasons:
  • if a GridResource ID doesn't exist
  • if a Gridlet ID doesn't exist
  • if a Gridlet's user ID doesn't exist
  • if the delay time is negative
  • if a Gridlet object has finished executing beforehand. The Gridlet needs to be retrieved by using gridletReceive()
Pre Condition:
gridletId >= 0, userId >= 0, resourceId >= 0, delay >= 0.0
Post Condition:
$none

gridletStatus

protected int gridletStatus(Gridlet gl,
                            int resourceId)
Gets the current status of this Gridlet in a given GridResource ID

Parameters:
gl - a Gridlet object
resourceId - a GridResource ID that executes this Gridlet object
Returns:
the current Gridlet status or -1 if not found. The various Gridlet status can be found in GridSimTags class.
See Also:
GridSimTags
Pre Condition:
gl != null, resourceId > 0
Post Condition:
$none

gridletStatus

protected int gridletStatus(int gridletId,
                            int userId,
                            int resourceId)
Gets the current status of this Gridlet in a given GridResource ID

Parameters:
gridletId - a Gridlet ID
userId - the user or owner of this Gridlet object
resourceId - a GridResource ID that executes this Gridlet object
Returns:
the current Gridlet status or -1 if not found. The various Gridlet status can be found in GridSimTags class.
See Also:
GridSimTags
Pre Condition:
gridletId > 0, userId > 0, resourceId > 0
Post Condition:
$none

gridletResume

protected boolean gridletResume(Gridlet gl,
                                int resId,
                                double delay)
Resumes a Gridlet that is currently pausing in a given GridResource ID with a delay.
NOTE: Resuming a Gridlet only works if it is currently on paused.

Parameters:
gl - a Gridlet object to be sent
resId - an unique resource ID
delay - delay time or 0.0 if want to execute NOW
Returns:
true if this Gridlet has been resumed successfully in the destination GridResource, false otherwise. Resuming a Gridlet can be failed for the one or more following reasons:
  • if a GridResource ID doesn't exist
  • if a Gridlet ID doesn't exist
  • if a Gridlet's user ID doesn't exist
  • if the delay time is negative
  • if a Gridlet object is null or empty
  • if a Gridlet is not currently on paused
Pre Condition:
gl != null, resId >= 0, delay >= 0.0
Post Condition:
$none

gridletResume

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.
NOTE: Resuming a Gridlet only works if it is currently on paused.

Parameters:
gridletId - a Gridlet ID
userId - the user or owner ID of this Gridlet
resourceId - an unique resource ID
delay - delay time or 0.0 if want to execute NOW
ack - an acknowledgement, i.e. true if wanted to know whether this operation is success or not, false otherwise (don't care)
Returns:
true if this Gridlet has been resumed successfully in the destination GridResource, false otherwise. Resuming a Gridlet can be failed for the one or more following reasons:
  • if a GridResource ID doesn't exist
  • if a Gridlet ID doesn't exist
  • if a Gridlet's user ID doesn't exist
  • if the delay time is negative
  • if a Gridlet is not currently on paused
Pre Condition:
gridletId >= 0, userId >= 0, resourceId >= 0, delay >= 0.0
Post Condition:
$none

gridletMove

protected boolean gridletMove(Gridlet gl,
                              int srcId,
                              int destId,
                              double delay)
Moves a Gridlet to the destination GridResource ID

Parameters:
gl - a Gridlet object
srcId - the GridResource ID that is currently executing this Gridlet
destId - the new GridResource ID
delay - simulation delay
Returns:
true if this Gridlet has moved successfully, false otherwise. Moving a Gridlet can be failed, due to one or more following reasons:
  • if a Gridlet object is null
  • if one or both GridResource ID don't exist
  • if the delay is negative
  • if a Gridlet in the GridResource has completed beforehand. The Gridlet can be retrieved by using gridletReceive()
Pre Condition:
gl != null, srcId > 0, destId > 0, delay >= 0.0
Post Condition:
$result = true || false

gridletMove

protected boolean gridletMove(int gridletId,
                              int userId,
                              int srcId,
                              int destId,
                              double delay,
                              boolean ack)
Moves a Gridlet to the destination GridResource ID

Parameters:
gridletId - a Gridlet ID
userId - the owner or user ID of this Gridlet
srcId - the GridResource ID that is currently executing this Gridlet
destId - the new GridResource ID
delay - simulation delay
ack - an acknowledgement, i.e. true if wanted to know whether this operation is success or not, false otherwise (don't care)
Returns:
true if this Gridlet has moved successfully, false otherwise. Moving a Gridlet can be failed, due to one or more following reasons:
  • if a Gridlet ID doesn't exist
  • if the owner of user ID of this Gridlet doesn't exist
  • if one or both GridResource ID don't exist
  • if the delay is negative
  • if a Gridlet in the GridResource has completed beforehand. The Gridlet can be retrieved by using gridletReceive()
Pre Condition:
gridletId > 0, userId > 0, srcId > 0, destId > 0, delay >= 0.0
Post Condition:
$result = true || false

GetEntityName

public String GetEntityName()
Deprecated. As of GridSim 2.1, replaced by getEntityName()

Gets the name of this entity

Returns:
the Entity name or null if this object does not have one
Pre Condition:
$none
Post Condition:
$none

getEntityName

public String getEntityName()
Gets the name of this entity

Returns:
the Entity name or null if this object does not have one
Pre Condition:
$none
Post Condition:
$none

GetEntityName

public static String GetEntityName(int entityID)
Deprecated. As of GridSim 2.1, replaced by getEntityName(int)

Gets name of the entity given its entity ID

Parameters:
entityID - the entity ID
Returns:
the Entity name or null if this object does not have one
Pre Condition:
entityID > 0
Post Condition:
$none

getEntityName

public static String getEntityName(int entityID)
Gets name of the entity given its entity ID

Parameters:
entityID - the entity ID
Returns:
the Entity name or null if this object does not have one
Pre Condition:
entityID > 0
Post Condition:
$none

GetEntityId

public static int GetEntityId(String entityName)
Deprecated. As of GridSim 2.1, replaced by getEntityId(String)

Gets the entity ID

Parameters:
entityName - an Entity name
Returns:
the Entity ID or -1 if it is not found
Pre Condition:
entityName != null
Post Condition:
$result >= -1

getEntityId

public static int getEntityId(String entityName)
Gets the entity ID given its name

Parameters:
entityName - an Entity name
Returns:
the Entity ID or -1 if it is not found
Pre Condition:
entityName != null
Post Condition:
$result >= -1

GridStatisticsEntityId

public static int GridStatisticsEntityId()
Deprecated. As of GridSim 2.1, replaced by getGridStatisticsEntityId()

Gets the entity id of GridStatistics

Returns:
the Entity ID or -1 if it is not found
Pre Condition:
$none
Post Condition:
$result >= -1

getGridStatisticsEntityId

public static int getGridStatisticsEntityId()
Gets the entity ID of GridStatistics

Returns:
the Entity ID or -1 if it is not found
Pre Condition:
$none
Post Condition:
$result >= -1

GridInformationServiceEntityId

public static int GridInformationServiceEntityId()
Deprecated. As of GridSim 2.1, replaced by getGridInfoServiceEntityId()

Gets the entity ID of GridInformationService

Returns:
the Entity ID or -1 if it is not found
Pre Condition:
$none
Post Condition:
$result >= -1

getGridInfoServiceEntityId

public static int getGridInfoServiceEntityId()
Gets the entity ID of GridInformationService

Returns:
the Entity ID or -1 if it is not found
Pre Condition:
$none
Post Condition:
$result >= -1

GridSimShutdownEntityId

public static int GridSimShutdownEntityId()
Deprecated. As of GridSim 2.1, replaced by getGridSimShutdownEntityId()

Gets the entity id of GridSimShutdown

Returns:
the Entity ID or -1 if it is not found
Pre Condition:
$none
Post Condition:
$result >= -1

getGridSimShutdownEntityId

public static int getGridSimShutdownEntityId()
Gets the entity id of GridSimShutdown

Returns:
the Entity ID or -1 if it is not found
Pre Condition:
$none
Post Condition:
$result >= -1

ShutdownUserEntity

protected void ShutdownUserEntity()
Deprecated. As of GridSim 2.1, replaced by shutdownUserEntity()

Tells all user entities to shut down the simulation. gridsim.GridSimShutdown entity waits for all users termination before shuting down other entities.

See Also:
GridSimShutdown
Pre Condition:
$none
Post Condition:
$none

shutdownUserEntity

protected void shutdownUserEntity()
Tells all user entities to shut down the simulation. gridsim.GridSimShutdown entity waits for all users termination before shuting down other entities.

See Also:
GridSimShutdown
Pre Condition:
$none
Post Condition:
$none

ShutdownGridStatisticsEntity

protected void ShutdownGridStatisticsEntity()
Deprecated. As of GridSim 2.1, replaced by shutdownGridStatisticsEntity()

Tells the GridStatistics entity the end of the simulation

Pre Condition:
$none
Post Condition:
$none

shutdownGridStatisticsEntity

protected void shutdownGridStatisticsEntity()
Tells the GridStatistics entity the end of the simulation

Pre Condition:
$none
Post Condition:
$none

GetGridResourceList

public static LinkedList GetGridResourceList()
Deprecated. As of GridSim 2.1, replaced by getGridResourceList()

Sends a request to Grid Information Service (GIS) entity to get the list of Grid resources

Returns:
A LinkedList containing GridResource ID (as an Integer object) or null if a GIS entity hasn't been created before
Pre Condition:
$none
Post Condition:
$none

getGridResourceList

public static LinkedList getGridResourceList()
Sends a request to Grid Information Service (GIS) entity to get the list of Grid resources

Returns:
A LinkedList containing GridResource ID (as an Integer object) or null if a GIS entity hasn't been created before
Pre Condition:
$none
Post Condition:
$none

GetResourceCharacteristics

public ResourceCharacteristics GetResourceCharacteristics(int resourceID)
Deprecated. As of GridSim 2.1, replaced by getResourceCharacteristics(int)

Gets a ResourceCharacteristics object for a given GridResource ID

Parameters:
resourceID - the resource ID
Returns:
An object of ResourceCharacteristics or null if a GridResource doesn't exist
See Also:
ResourceCharacteristics
Pre Condition:
resourceID > 0
Post Condition:
$none

getResourceCharacteristics

public ResourceCharacteristics getResourceCharacteristics(int resourceID)
Gets a ResourceCharacteristics object for a given GridResource id

Parameters:
resourceID - the resource ID
Returns:
An object of ResourceCharacteristics or null if a GridResource doesn't exist
See Also:
ResourceCharacteristics
Pre Condition:
resourceID > 0
Post Condition:
$none

GetResourceDynamicInformation

public Accumulator GetResourceDynamicInformation(int resourceID)
Deprecated. As of GridSim 2.1, replaced by getResourceDynamicInfo(int)

Gets the GridResource dynamic information

Parameters:
resourceID - the resource ID
Returns:
An object of Accumulator containing the GridResource load or null if a GridResource doesn't exist
Pre Condition:
resourceID > 0
Post Condition:
$none

getResourceDynamicInfo

public Accumulator getResourceDynamicInfo(int resourceID)
Gets the GridResource dynamic fnformation

Parameters:
resourceID - the resource ID
Returns:
An object of Accumulator containing the GridResource load or null if a GridResource doesn't exist
Pre Condition:
resourceID > 0
Post Condition:
$none

RecordStatistics

public void RecordStatistics(String category,
                             double data)
Deprecated. As of GridSim 2.1, replaced by recordStatistics(String, double)

Records statistics during the event

Parameters:
category - a category name
data - a value to be recorded
Pre Condition:
category != null, data >= 0.0
Post Condition:
$none

recordStatistics

public void recordStatistics(String category,
                             double data)
Records statistics during the event

Parameters:
category - a category name
data - a value to be recorded
Pre Condition:
category != null, data >= 0.0
Post Condition:
$none

RecordStatistics

public void RecordStatistics(String category,
                             int data)
Deprecated. As of GridSim 2.1, replaced by recordStatistics(String, int)

Records statistics during the event

Parameters:
category - a category name
data - a value to be recorded
Pre Condition:
category != null, data >= 0.0
Post Condition:
$none

recordStatistics

public void recordStatistics(String category,
                             int data)
Records statistics during the event

Parameters:
category - a category name
data - a value to be recorded
Pre Condition:
category != null, data >= 0.0
Post Condition:
$none

RecordStatistics

public void RecordStatistics(String category,
                             String data)
Deprecated. As of GridSim 2.1, replaced by recordStatistics(String, String)

Records statistics during the event

Parameters:
category - a category name
data - a value to be recorded
Pre Condition:
category != null, data != null
Post Condition:
$none

recordStatistics

public void recordStatistics(String category,
                             String data)
Records statistics during the event

Parameters:
category - a category name
data - a value to be recorded
Pre Condition:
category != null, data != null
Post Condition:
$none

RecordStatistics

public void RecordStatistics(String category,
                             boolean data)
Deprecated. As of GridSim 2.1, replaced by recordStatistics(String, boolean)

Records statistics during the event

Parameters:
category - a category name
data - a value to be recorded
Pre Condition:
category != null, data == true || false
Post Condition:
$none

recordStatistics

public void recordStatistics(String category,
                             boolean data)
Records statistics during the event

Parameters:
category - a category name
data - a value to be recorded
Pre Condition:
category != null, data == true || false
Post Condition:
$none