jsim.process
Class SimObject

java.lang.Object
  extended by jsim.coroutine.Coroutine
      extended by jsim.process.SimObject
All Implemented Interfaces:
java.lang.Runnable

public abstract class SimObject
extends Coroutine

The SimObject abstract class allows application specific entity classes to be derived from it (e.g., Customer). SimObject factors out features common to all entities.


Field Summary
protected  Variate branch
          Variate for branching
protected  int cloneId
          Identifier of the entity's clone
protected  boolean cloneStatus
          Clone status of the entity
 java.awt.Color eColor
          Entity's color for animation
 double eStartTime
          Entity's creation time
protected  boolean joinWait
          Status of entity waiting for join
protected  int priority
          Entity's priority
protected  int simClassId
          Class of an entity 'Temporary change from final variable to non-final'
protected  double simCost
          Cost statistics collected by all entities (sample or batch).
protected  int simId
          Unique identifier for entity
protected static java.util.logging.Logger trc
          Tracing messages
 
Fields inherited from class jsim.coroutine.Coroutine
life, name, NORM_PRIORITY
 
Constructor Summary
SimObject()
          Construct an entity (SimObject).
SimObject(int simClassID)
          Construct an entity (SimObject).
 
Method Summary
 void _end()
          Terminate the entity.
 int get_Priority()
          Get the priority of the entity.
 int get_simClassId()
          Get the class type of an entity.
 int getCloneId()
          Return the cloneId of the SimObject
 double getCost()
           
 java.awt.Color getEColor()
          Return the color of the SimObject
protected  Model getEnvironment()
          Get the environment.
 java.util.LinkedList<Coroutine> getLiveEntity()
          Get the list containing the live entities.
 double getServiceCost()
           
 int getSimId()
          Return the id of the SimObject
static void incLostEntities()
          Increment the number of lost entities.
 boolean isClone()
          Return the clone status of the SimObject
 void set_Priority(int priority)
          Set the priority of the entity.
 void set_simClassId(int simClassId)
          Set the class type of an entity.
 void setCloneId(int cloneId)
          Set the clone Id of the entity
 void setCloneStatus(boolean cloneStatus)
          Set the clone status of the entity
 void setCost(double cost)
           
 void setEColor(java.awt.Color eColor)
          Set the color of the entity
protected  void setEnvironment(Model env)
          Set the environment.
 void setJoinWait(boolean joinWait)
          Set the join wait status of the entity
 void tally(double cost)
          Tally the cost statistics for entities
 boolean waitingOnJoin()
          Return the join wait status of the SimObject
 
Methods inherited from class jsim.coroutine.Coroutine
DebugPQ, end, getTime, initiateJoin, isTerminal, joinGroup, kickOut, main, pause, preempt, run, setActTime, setState, start, waitForJoin, waitIn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

trc

protected static java.util.logging.Logger trc
Tracing messages


simId

protected final int simId
Unique identifier for entity


cloneId

protected int cloneId
Identifier of the entity's clone


cloneStatus

protected boolean cloneStatus
Clone status of the entity


joinWait

protected boolean joinWait
Status of entity waiting for join


simClassId

protected int simClassId
Class of an entity 'Temporary change from final variable to non-final'


eColor

public java.awt.Color eColor
Entity's color for animation


eStartTime

public final double eStartTime
Entity's creation time


branch

protected final Variate branch
Variate for branching


priority

protected int priority
Entity's priority


simCost

protected double simCost
Cost statistics collected by all entities (sample or batch).

Constructor Detail

SimObject

public SimObject()
Construct an entity (SimObject).

Parameters:
env - environment (containing model)

SimObject

public SimObject(int simClassID)
Construct an entity (SimObject).

Parameters:
env - environment (containing model)
Method Detail

setEnvironment

protected void setEnvironment(Model env)
Set the environment. (FIX)

Parameters:
env - The entity's environment

getEnvironment

protected Model getEnvironment()
Get the environment. (FIX)

Returns:
Model The entity's environment

set_Priority

public void set_Priority(int priority)
Set the priority of the entity.

Parameters:
priority - New priority.

get_Priority

public int get_Priority()
Get the priority of the entity.

Returns:
int entity's current priority

set_simClassId

public void set_simClassId(int simClassId)
Set the class type of an entity.

Parameters:
simClassId - Class Id.

get_simClassId

public int get_simClassId()
Get the class type of an entity.

Returns:
simClassId the class Id of the entity.

_end

public void _end()
Terminate the entity.


incLostEntities

public static void incLostEntities()
Increment the number of lost entities.


getLiveEntity

public java.util.LinkedList<Coroutine> getLiveEntity()
Get the list containing the live entities.

Returns:
java.util.LinkedList LinkedList of live entities

getSimId

public int getSimId()
Return the id of the SimObject


setEColor

public void setEColor(java.awt.Color eColor)
Set the color of the entity

Parameters:
eColor - the color of the entity

getEColor

public java.awt.Color getEColor()
Return the color of the SimObject

Returns:
Color color of the SimObject

setCloneId

public void setCloneId(int cloneId)
Set the clone Id of the entity

Parameters:
cloneId - clone Id of the entity

getCloneId

public int getCloneId()
Return the cloneId of the SimObject


setCloneStatus

public void setCloneStatus(boolean cloneStatus)
Set the clone status of the entity

Parameters:
cloneStatus - clone Id of the entity

isClone

public boolean isClone()
Return the clone status of the SimObject


setJoinWait

public void setJoinWait(boolean joinWait)
Set the join wait status of the entity

Parameters:
joinWait - join wait status of the entity

waitingOnJoin

public boolean waitingOnJoin()
Return the join wait status of the SimObject


tally

public void tally(double cost)
Tally the cost statistics for entities


getCost

public double getCost()

setCost

public void setCost(double cost)

getServiceCost

public double getServiceCost()