gridsim
Class GridSim

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--eduni.simjava.Sim_entity
              |
              +--gridsim.GridSim
Direct Known Subclasses:
GridInformationService, GridResource, GridSimShutdown, GridStatistics

public class GridSim
extends Sim_entity

The top most GridSim class that all GridSim entities need to extend
to become concurrent entities. They automatically inherit all
properties of entity which extends thread class. All entities
extending GridSim should defined a body() method inwhich
entitity actions (e.g., raising, processing, and receiveing events to communicate
with other entities) are performed.
When the execution of an entity is initiated by Start method,
the method body() is automatically invoked by entity thread.
Entities should exit body() method when there are no more
interested in handling events.


Field Summary
 static GridSimRandomrand
           
 static DateSimulationStartDate
           

Fields inherited from class java.lang.Thread
MIN_PRIORITY, NORM_PRIORITY, MAX_PRIORITY

Constructor Summary
GridSim(String name)
          Entity WITHOUT NETWORK communication channels: "input" and "output" Sim_port.
GridSim(String name, double baud_rate)
          Entitity with NETWORK communication channels: "input" and "output" Sim_port

Method Summary
 static doubleClock()
          Get Current Simulation Time.
 static intGetEntityId(String EntityName)
          It returns ID (int value) of the Entity given its name
 static StringGetEntityName(int EntityID)
          Returns name of the entity given its Entity ID
 LinkedListGetGridResourceList()
          It send sends a request to GIS entity to get the list of Grid resources.
 static DateGetSimulationStartDate()
           
 static intGridInformationServiceEntityId()
          It returns ID of the Entity named "GridInformationService"
 voidGridSimHold(double duration)
          Causes the entity to hold for duration units of simulation time.
 static intGridSimShutdownEntityId()
          It returns ID of Entity named "GridSimShutdown"
 static intGridStatisticsEntityId()
          It returns ID of the Entity named "GridStatistics"
 static voidInit(int no_of_users, Calendar cal, boolean traceFlag, String[] exclude_from_file, String[] exclude_from_processing, String ReportWriterName)
          Initialise GridSim Parameters.
 booleanIsNetworked()
          Check type of entity
 voidRecordStatistics(String category, double data)
           
 voidRecordStatistics(String category, int data)
           
 voidRecordStatistics(String category, String data)
           
 voidRecordStatistics(String category, boolean data)
           
 static voidStart()
          Start the execution of GridSim simulation.
 static voidStop()
          Stop Grid Simulation.

Methods inherited from class eduni.simjava.Sim_entity
set_invisible, get_name, get_id, get_port, get_port, add_port, add_param, body, sim_hold, sim_hold_for, sim_trace, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_wait, sim_waiting, sim_waiting, sim_select, sim_cancel, sim_wait_for, sim_putback, sim_get_next, sim_get_next, sim_current, send_on, run

Methods inherited from class java.lang.Thread
currentThread, yield, sleep, sleep, start, stop, stop, interrupt, interrupted, isInterrupted, destroy, isAlive, suspend, resume, setPriority, getPriority, setName, getName, getThreadGroup, activeCount, enumerate, countStackFrames, join, join, join, dumpStack, setDaemon, isDaemon, checkAccess, toString, getContextClassLoader, setContextClassLoader

Methods inherited from class java.lang.Object
getClass, hashCode, equals, notify, notifyAll, wait, wait, wait

Field Detail

rand

public static GridSimRandom rand

SimulationStartDate

public static Date SimulationStartDate
Constructor Detail

GridSim

public GridSim(String name)
Entity WITHOUT NETWORK communication channels: "input" and "output" Sim_port.

GridSim

public GridSim(String name, double baud_rate)
Entitity with NETWORK communication channels: "input" and "output" Sim_port
Method Detail

Clock

public static double Clock()
Get Current Simulation Time.
Returns: The current simulation time from the simulation clock

GetEntityId

public static int GetEntityId(String EntityName)
It returns ID (int value) of the Entity given its name

GetEntityName

public static String GetEntityName(int EntityID)
Returns name of the entity given its Entity ID

GetGridResourceList

public LinkedList GetGridResourceList()
It send sends a request to GIS entity to get the list of Grid resources.
returns A LinkedList containing GridResourceId as Integer Object.

GetSimulationStartDate

public static Date GetSimulationStartDate()

GridInformationServiceEntityId

public static int GridInformationServiceEntityId()
It returns ID of the Entity named "GridInformationService"

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.

GridSimShutdownEntityId

public static int GridSimShutdownEntityId()
It returns ID of Entity named "GridSimShutdown"

GridStatisticsEntityId

public static int GridStatisticsEntityId()
It returns ID of the Entity named "GridStatistics"

Init

public static void Init(int no_of_users, Calendar cal, boolean traceFlag, String[] exclude_from_file, String[] exclude_from_processing, String ReportWriterName)
Initialise GridSim Parameters.
This should be called before creating any entities.
Parameters:
no_of_users - The number of User Entities created. This parameters indicates that
GridSimShutdown first waits for User Entities's END_OF_SIMULATION signal before issuing
terminate singal to other entities.
cal - The calender object for storing peaktime, holiday, etc. time
traceFlag - true if GridSim trace need to be written.
exclude_from_file
exclude_from_processing
ReportWriterName - The name of the entities which is signaled to write
write any specific report just before termination of the simulation.

IsNetworked

public boolean IsNetworked()
Check type of entity
Returns: true if entity has NETWORK communication channel

RecordStatistics

public void RecordStatistics(String category, double data)

RecordStatistics

public void RecordStatistics(String category, int data)

RecordStatistics

public void RecordStatistics(String category, String data)

RecordStatistics

public void RecordStatistics(String category, boolean data)

Start

public static void Start()
Start the execution of GridSim simulation.
It waits for complete execution of all entitities, i.e., until
all entities thread reach non-RUNNABLE state by exiting from the body() method.
Then, kills threads of all entities.
Note: This method should be called after all the entities have been setup and
added, and their ports linked.

Stop

public static void Stop()
Stop Grid Simulation.
This should be called only any of the user defined entities Explicitly want
to terminate simulation during execution.

Association Links

to Class eduni.simjava.Sim_port

to Class eduni.simjava.Sim_port

to Class java.util.Date

to Class gridsim.GridSimRandom