gridsim
Class GridSim

Object
  |
  +--Thread
        |
        +--eduni.simjava.Sim_entity
              |
              +--gridsim.GridSim
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
Broker, GridInformationService, GridResource, GridSimShutdown, GridStatistics, ReportWriter, UserEntity

public class GridSim
extends eduni.simjava.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.1, June 2003
Author:
Manzur Murshed and Rajkumar Buyya
See Also:
Sim_entity, Output, Input, GridInformationService, GridSimShutdown, GridStatistics
Invariant:
$none

Field Summary
protected  eduni.simjava.Sim_port input
          Reading data received via input port
protected  eduni.simjava.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 Sim_system.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 Entities managing NETWORK communication channels
static int getEntityId(String entityName)
          Gets ID of the Entity given its name
static int GetEntityId(String entityName)
          Deprecated. As of GridSim 2.1, replaced by getEntityId(String)
 String getEntityName()
          Gets the name of the current 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 ID of Entity named "GridInformationService"
 LinkedList getGridResourceList()
          Sends a request to Grid Information Service (GIS) entity to get the list of Grid resources
 LinkedList GetGridResourceList()
          Deprecated. As of GridSim 2.1, replaced by getGridResourceList()
static int getGridSimShutdownEntityId()
          Gets ID of Entity named "GridSimShutdown"
static int getGridStatisticsEntityId()
          Gets ID of Entity named "GridStatistics"
 ResourceCharacteristics getResourceCharacteristics(int resourceID)
          Gets a ResourceCharacteristics object
 ResourceCharacteristics GetResourceCharacteristics(int resourceID)
          Deprecated. As of GridSim 2.1, replaced by getResourceCharacteristics(int)
 Accumulator getResourceDynamicInfo(int resourceID)
          Gets Resource Dynamic Information
 Accumulator GetResourceDynamicInformation(int resourceID)
          Deprecated. As of GridSim 2.1, replaced by getResourceDynamicInfo(int)
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  void GridletCancel(Gridlet gl, int resource_id)
          Cancels a Gridlet object NOT YET IMPLEMENTED
protected  Gridlet gridletReceive()
          Gets a Gridlet object passed in this event
protected  Gridlet GridletReceive()
          Deprecated. As of GridSim 2.1, replaced by gridletReceive()
protected  void gridletSubmit(Gridlet gl, int resourceID)
          Sends a gridlet based on its resource ID to Entity
protected  void GridletSubmit(Gridlet gl, int resourceID)
          Deprecated. As of GridSim 2.1, replaced by gridletSubmit(Gridlet, int)
 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(eduni.simjava.Sim_port sourcePort)
          Gets the data passed in this event
protected  Object ReceiveEventObject(eduni.simjava.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 Entity by 'delaying' simulation time from now with user-defined tag representing the type of event.
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 Entity by 'delaying' simulation time from now with user-defined tag representing the type of event.
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(eduni.simjava.Sim_port destPort, double delay, int gridSimTag)
          Sends an event/message to Entity by 'delaying' simulation time from now with user-defined tag representing the type of event.
protected  void Send(eduni.simjava.Sim_port destPort, double delay, int gridSimTag)
          Deprecated. As of GridSim 2.1, replaced by send(Sim_port, double, int)
protected  void send(eduni.simjava.Sim_port destPort, double delay, int gridSimTag, Object data)
          Sends an event/message to Entity by 'delaying' simulation time from now with user-defined tag representing the type of event.
protected  void Send(eduni.simjava.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 Entity by 'delaying' simulation time from now with user-defined tag representing the type of event.
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 Entity by 'delaying' simulation time from now with user-defined tag representing the type of event.
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 all user entities that defined ReportWriter to shut down 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 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_param, add_port, body, get_id, get_name, get_port, get_port, run, send_on, set_invisible, sim_cancel, sim_current, sim_get_next, sim_get_next, sim_hold_for, sim_hold, sim_putback, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_select, sim_trace, 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
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

input

protected eduni.simjava.Sim_port input
Reading data received via input port


output

protected eduni.simjava.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.

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 - communication 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 Entities managing NETWORK communication channels

Overrides:
finalize in class Object
See Also:
terminateIOEntities()
Pre Condition:
$none
Post Condition:
$none

finalizeGridSimulation

protected void finalizeGridSimulation()
It terminates Entities managing 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

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 Sim_system.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 Sim_system.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 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 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 Entity by 'delaying' simulation time from now with user-defined tag representing the type of event.

Parameters:
entityName - the name of the destination entity
delay - how long the event/message should be delivered from the current simulation time
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 Entity by 'delaying' simulation time from now with user-defined tag representing the type of event.

Parameters:
entityName - the name of the destination entity
delay - how long the event/message should be delivered from the current simulation time
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 Entity by 'delaying' simulation time from now with user-defined tag representing the type of event.

Parameters:
entityName - the name of the destination entity
delay - how long the event/message should be delivered from the current simulation time
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 Entity by 'delaying' simulation time from now with user-defined tag representing the type of event.

Parameters:
entityName - the name of the destination entity
delay - how long the event/message should be delivered from the current simulation time
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 Entity by 'delaying' simulation time from now with user-defined tag representing the type of event.

Parameters:
entityID - the id number of the destination entity
delay - how long the event/message should be delivered from the current simulation time
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 Entity by 'delaying' simulation time from now with user-defined tag representing the type of event.

Parameters:
entityID - the id number of the destination entity
delay - how long the event/message should be delivered from the current simulation time
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 Entity by 'delaying' simulation time from now with user-defined tag representing the type of event.

Parameters:
entityID - the id number of the destination entity
delay - how long the event/message should be delivered from the current simulation time
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 Entity by 'delaying' simulation time from now with user-defined tag representing the type of event.

Parameters:
entityID - the id number of the destination entity
delay - how long the event/message should be delivered from the current simulation time
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(eduni.simjava.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 Entity by 'delaying' simulation time from now with user-defined tag representing the type of event.

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
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(eduni.simjava.Sim_port destPort,
                    double delay,
                    int gridSimTag)
Sends an event/message to Entity by 'delaying' simulation time from now with user-defined tag representing the type of event.

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
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(eduni.simjava.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 Entity by 'delaying' simulation time from now with user-defined tag representing the type of event.

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
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(eduni.simjava.Sim_port destPort,
                    double delay,
                    int gridSimTag,
                    Object data)
Sends an event/message to Entity by 'delaying' simulation time from now with user-defined tag representing the type of event.

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
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(eduni.simjava.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
See Also:
Sim_port
Pre Condition:
sourcePort != null
Post Condition:
$result != null

receiveEventObject

protected Object receiveEventObject(eduni.simjava.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
See Also:
Sim_port
Pre Condition:
sourcePort != null
Post Condition:
$result != null

GridletSubmit

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

Sends a gridlet based on its resource ID to Entity

Parameters:
gl - a Gridlet object to be sent
resourceID - a unique resource ID
Pre Condition:
gl != null, resourceID > 0
Post Condition:
$none

gridletSubmit

protected void gridletSubmit(Gridlet gl,
                             int resourceID)
Sends a gridlet based on its resource ID to Entity

Parameters:
gl - a Gridlet object to be sent
resourceID - a unique resource ID
Pre Condition:
gl != null, resourceID > 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 void GridletCancel(Gridlet gl,
                             int resource_id)
Cancels a Gridlet object NOT YET IMPLEMENTED

Parameters:
gl - a Gridlet object
resource_id - a grid resource id
Pre Condition:
gl != null, resource_id >= 0
Post Condition:
$none

GetEntityName

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

Gets the name of the current 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 the current 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 ID of the Entity 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

getEntityId

public static int getEntityId(String entityName)
Gets ID of the Entity 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 ID of Entity named "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 ID of Entity named "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 ID of Entity named "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 ID of Entity named "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 ID of Entity named "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 ID of Entity named "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 all user entities that defined ReportWriter to shut down the simulation. If a ReportWriter is NOT defined (i.e. null) during GridSim.Init(), then gridsim.GridSimShutdown will invoke it.

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

shutdownGridStatisticsEntity

protected void shutdownGridStatisticsEntity()
Tells all user entities that defined ReportWriter to shut down the simulation. If a ReportWriter is NOT defined (i.e. null) during GridSim.Init(), then gridsim.GridSimShutdown will invoke it.

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

GetGridResourceList

public 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)
Pre Condition:
$none
Post Condition:
$result != null

getGridResourceList

public 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)
Pre Condition:
$none
Post Condition:
$result != null

GetResourceCharacteristics

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

Gets a ResourceCharacteristics object

Parameters:
resourceID - the resource ID
Returns:
An object of gridsim.ResourceCharacteristics
See Also:
ResourceCharacteristics
Pre Condition:
resourceID > 0
Post Condition:
$result != null

getResourceCharacteristics

public ResourceCharacteristics getResourceCharacteristics(int resourceID)
Gets a ResourceCharacteristics object

Parameters:
resourceID - the resource ID
Returns:
An object of gridsim.ResourceCharacteristics
See Also:
ResourceCharacteristics
Pre Condition:
resourceID > 0
Post Condition:
$result != null

GetResourceDynamicInformation

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

Gets Resource Dynamic Information

Parameters:
resourceID - the resource ID
Returns:
An object of Accumulator containing the resource load
Pre Condition:
resourceID > 0
Post Condition:
$result != null

getResourceDynamicInfo

public Accumulator getResourceDynamicInfo(int resourceID)
Gets Resource Dynamic Information

Parameters:
resourceID - the resource ID
Returns:
An object of Accumulator containing the resource load
Pre Condition:
resourceID > 0
Post Condition:
$result != null

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