GridSim
v3.2

gridsim.net
Class Output

Object
  extended byThread
      extended byeduni.simjava.Sim_entity
          extended bygridsim.net.Output
All Implemented Interfaces:
Cloneable, Runnable

public class Output
extends Sim_entity

GridSim Output defines a port through which a simulation entity sends data to the simulated network.

It maintains an event queue to serialize the data-out-flow and delivers to the destination entity. It works along with Input entity to simulate network communication delay. Simultaneous outputs can be modeled by using multiple instances of this class

Since:
GridSim Toolkit 1.0
Author:
Manzur Murshed and Rajkumar Buyya
Invariant:
$none

Field Summary
 
Fields inherited from class eduni.simjava.Sim_entity
 
Fields inherited from class Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Output(String name, double baudRate)
          Allocates a new Output object
 
Method Summary
 void addLink(Link link)
          Sets this entity's link.
 void body()
          A method that gets one process event at one time until the end of a simulation, then delivers an event to the entity (its parent)
 double getBaudRate()
          Gets the baud rate
 double GetBaudRate()
          Deprecated. As of GridSim 2.1, replaced by getBaudRate()
 double real_io(double value)
          Deprecated. As of GridSim 2.1, replaced by realIO(double)
 double realIO(double value)
          Gets the I/O real number based on a given value
 boolean setBackgroundTraffic(TrafficGenerator gen)
          Sets the background traffic generator for this entity.
 boolean setBackgroundTraffic(TrafficGenerator gen, Collection userName)
          Sets the background traffic generator for this entity.
 
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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Output

public Output(String name,
              double baudRate)
       throws NullPointerException
Allocates a new Output object

Parameters:
name - the name of this object
baudRate - the communication speed
Throws:
NullPointerException - This happens when creating this entity before initializing GridSim package or this entity name is null or empty
Pre Condition:
name != null, baudRate >= 0.0
Post Condition:
$none
Method Detail

setBackgroundTraffic

public boolean setBackgroundTraffic(TrafficGenerator gen)
Sets the background traffic generator for this entity.

When simulation starts, this entity will automatically sends junk packets to resource entities.

Parameters:
gen - a background traffic generator
Returns:
true if successful, false otherwise
Pre Condition:
gen != null
Post Condition:
$none

setBackgroundTraffic

public boolean setBackgroundTraffic(TrafficGenerator gen,
                                    Collection userName)
Sets the background traffic generator for this entity.

When simulation starts, this entity will automatically sends junk packets to resource entities and other entities.
NOTE: Sending background traffic to itself is not supported.

Parameters:
gen - a background traffic generator
userName - a collection of user entity name (in String object).
Returns:
true if successful, false otherwise
Pre Condition:
gen != null, userName != null
Post Condition:
$none

addLink

public void addLink(Link link)
Sets this entity's link. This should be used only if the network extensions are being used.

Parameters:
link - the link to which this Output entity should send data
Pre Condition:
link != null
Post Condition:
$none

GetBaudRate

public double GetBaudRate()
Deprecated. As of GridSim 2.1, replaced by getBaudRate()

Gets the baud rate

Returns:
the baud rate
Pre Condition:
$none
Post Condition:
$result >= 0.0

getBaudRate

public double getBaudRate()
Gets the baud rate

Returns:
the baud rate
Pre Condition:
$none
Post Condition:
$result >= 0.0

real_io

public double real_io(double value)
Deprecated. As of GridSim 2.1, replaced by realIO(double)

Gets the I/O real number based on a given value

Parameters:
value - the specified value
Returns:
real number
Pre Condition:
$none
Post Condition:
$result >= 0.0

realIO

public double realIO(double value)
Gets the I/O real number based on a given value

Parameters:
value - the specified value
Returns:
real number
Pre Condition:
$none
Post Condition:
$result >= 0.0

body

public void body()
A method that gets one process event at one time until the end of a simulation, then delivers an event to the entity (its parent)

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

GridSim
v3.2

The University of Melbourne, Australia, 2005