gridsim
Class GridResource

Object
  extended byThread
      extended byeduni.simjava.Sim_entity
          extended bygridsim.GridSim
              extended bygridsim.GridResource
All Implemented Interfaces:
Cloneable, Runnable

public class GridResource
extends GridSim

GridSim GridResource extends the gridsim.GridSim class and gains communication and concurrent entity capability. An instance of this class stimulates a resource with properties defined in an object of gridsim.ResourceCharacteristics class.

The process of creating a Grid resource is as follows:

  1. create PE (Processing Element) objects with a suitable MIPS (Million Instructions Per Second) or SPEC (Standard Performance Evaluation Corporation) rating;
  2. assemble them together to create a machine;
  3. group one or more objects of the machine to form a Grid resource

A resource having a single machine with one or more PEs (Processing Elements) is managed as a time-shared system using a round-robin scheduling algorithm. A resource with multiple machines is treated as a distributed memory cluster and is managed as a space-shared system using FCFS (First Come Firt Serve) scheduling policy or its variants.

Since GridSim 2.2, other scheduling algorithm can be added externally (without compiling or replacing the existing GridSim JAR file) into a Grid resource. For more information, look on tutorial page or AllocPolicy class.

Version:
2.2, December 2003
Author:
Manzur Murshed and Rajkumar Buyya
See Also:
GridSim, ResourceCharacteristics, AllocPolicy
Invariant:
$none

Field Summary
 
Fields inherited from class gridsim.GridSim
input, output, rand, SimulationStartDate
 
Fields inherited from class eduni.simjava.Sim_entity
 
Fields inherited from class Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
GridResource(String name, double baud_rate, long seed, ResourceCharacteristics resource, double peakLoad, double offPeakLoad, double relativeHolidayLoad, LinkedList weekends, LinkedList holidays)
          Allocates a new GridResource object
GridResource(String name, double baud_rate, ResourceCharacteristics resource, ResourceCalendar calendar)
          Allocates a new GridResource object
GridResource(String name, double baud_rate, ResourceCharacteristics resource, ResourceCalendar calendar, AllocPolicy policy)
          Allocates a new GridResource object
 
Method Summary
 void body()
          Handles external events that are coming to this GridResource entity.
 void SpaceShare_AllocatePEtoGridlet(Gridlet gl)
          Deprecated. As of GridSim 2.2, this method is OBSOLETE.
 void spaceShared_AllocatePEtoGridlet(Gridlet gl)
          Deprecated. As of GridSim 2.2, this method is OBSOLETE.
 
Methods inherited from class gridsim.GridSim
clock, Clock, finalize, finalizeGridSimulation, getEntityId, GetEntityId, getEntityName, GetEntityName, getEntityName, GetEntityName, getGridInfoServiceEntityId, getGridResourceList, GetGridResourceList, getGridSimShutdownEntityId, getGridStatisticsEntityId, getResourceCharacteristics, GetResourceCharacteristics, getResourceDynamicInfo, GetResourceDynamicInformation, getSimulationCalendar, getSimulationStartDate, GetSimulationStartDate, GridInformationServiceEntityId, gridletCancel, gridletCancel, gridletMove, gridletMove, gridletPause, gridletPause, gridletReceive, GridletReceive, gridletResume, gridletResume, gridletStatus, gridletStatus, gridletSubmit, GridletSubmit, gridletSubmit, gridSimHold, GridSimHold, GridSimShutdownEntityId, GridStatisticsEntityId, init, Init, isNetworked, IsNetworked, receiveEventObject, ReceiveEventObject, receiveEventObject, ReceiveEventObject, recordStatistics, RecordStatistics, recordStatistics, RecordStatistics, recordStatistics, RecordStatistics, recordStatistics, RecordStatistics, send, Send, send, Send, send, Send, send, Send, send, Send, send, Send, shutdownGridStatisticsEntity, ShutdownGridStatisticsEntity, shutdownUserEntity, ShutdownUserEntity, Start, startGridSimulation, Stop, stopGridSimulation, TerminateInputOutputEntities, terminateIOEntities
 
Methods inherited from class eduni.simjava.Sim_entity
add_generator, add_param, add_port, clone, get_id, get_name, get_port, get_port, get_stat, run, send_on, set_invisible, set_stat, sim_cancel, sim_completed, sim_current, sim_get_next, sim_get_next, sim_hold_for, sim_hold, sim_pause_for, sim_pause_for, sim_pause_until, sim_pause_until, sim_pause, sim_process_for, sim_process_for, sim_process_until, sim_process_until, sim_process, sim_putback, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_select, sim_trace, sim_wait_for, sim_wait_for, sim_wait_for, sim_wait, sim_waiting, sim_waiting
 
Methods inherited from class Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GridResource

public GridResource(String name,
                    double baud_rate,
                    long seed,
                    ResourceCharacteristics resource,
                    double peakLoad,
                    double offPeakLoad,
                    double relativeHolidayLoad,
                    LinkedList weekends,
                    LinkedList holidays)
             throws Exception
Allocates a new GridResource object

Parameters:
name - the name to be associated with this entity (as required by Sim_entity class from simjava package)
baud_rate - network communication or bandwidth speed
seed - the initial seed
resource - an object of ResourceCharacteristics
peakLoad - the load during peak times
offPeakLoad - the load during off peak times
relativeHolidayLoad - the load during holiday times
weekends - a linked-list contains the weekend days
holidays - a linked-list contains the public holidays
Throws:
Exception - This happens when one of the following scenarios occur:
See Also:
GridSim.init(int, Calendar, boolean, String[], String[], String)
Pre Condition:
$none
Post Condition:
$none

GridResource

public GridResource(String name,
                    double baud_rate,
                    ResourceCharacteristics resource,
                    ResourceCalendar calendar)
             throws Exception
Allocates a new GridResource object

Parameters:
name - the name to be associated with this entity (as required by Sim_entity class from simjava package)
baud_rate - network communication or bandwidth speed
resource - an object of ResourceCharacteristics
calendar - an object of ResourceCalendar
Throws:
Exception - This happens when one of the following scenarios occur:
See Also:
GridSim.init(int, Calendar, boolean, String[], String[], String)
Pre Condition:
$none
Post Condition:
$none

GridResource

public GridResource(String name,
                    double baud_rate,
                    ResourceCharacteristics resource,
                    ResourceCalendar calendar,
                    AllocPolicy policy)
             throws Exception
Allocates a new GridResource object

Parameters:
name - the name to be associated with this entity (as required by Sim_entity class from simjava package)
baud_rate - network communication or bandwidth speed
resource - an object of ResourceCharacteristics
calendar - an object of ResourceCalendar
policy - a scheduling policy for this Grid resource. If no scheduling policy is defined, the default one is SpaceShared
Throws:
Exception - This happens when one of the following scenarios occur:
See Also:
GridSim.init(int, Calendar, boolean, String[], String[], String), AllocPolicy
Pre Condition:
$none
Post Condition:
$none
Method Detail

body

public void body()
Handles external events that are coming to this GridResource entity. This method also registers this GridResource entity to GridInformationService class.

The services available to other GridSim entities are:

Overrides:
body in class Sim_entity
Pre Condition:
$none
Post Condition:
$none

SpaceShare_AllocatePEtoGridlet

public void SpaceShare_AllocatePEtoGridlet(Gridlet gl)
Deprecated. As of GridSim 2.2, this method is OBSOLETE.

As of GridSim 2.2, this method is OBSOLETE. Allocates one of the PEs to Gridlet for execution and schedules an internal event to be delivered at completion time.

Parameters:
gl - a Gridlet to be processed
Pre Condition:
gl != null
Post Condition:
$none

spaceShared_AllocatePEtoGridlet

public void spaceShared_AllocatePEtoGridlet(Gridlet gl)
Deprecated. As of GridSim 2.2, this method is OBSOLETE.

As of GridSim 2.2, this method is OBSOLETE. Allocates one of the PEs to Gridlet for execution and schedules an internal event to be delivered at completion time.

Parameters:
gl - a Gridlet to be processed
Pre Condition:
gl != null
Post Condition:
$none