jsim.process
Class Source

java.lang.Object
  extended by jsim.process.DynamicNode
      extended by jsim.process.Source
All Implemented Interfaces:
java.lang.Runnable

public class Source
extends DynamicNode
implements java.lang.Runnable

The Source class allows generators (sources) of entities to be created. A Source object periodically creates entities (SimObjects) of a given type.


Field Summary
 
Fields inherited from class jsim.process.DynamicNode
costs, duration, occupancy, outgoing, props, trc
 
Constructor Summary
Source(int id, Prop props, double stopTime, java.lang.String entityTName, Transport[] outgoing, AnimationQueue queue)
          Constructor which uses id Constructs a Source of entities.
Source(int id, Prop props, java.lang.String entityTName, Transport[] outgoing, AnimationQueue queue)
          Uses id for Animator Constructs a Source of entities.
Source(Prop props, double stopTime, java.lang.String entityTName, Transport[] outgoing, AnimationQueue queue)
          Constructs a Source of entities.
Source(Prop props, java.lang.String entityTName, Transport[] outgoing, AnimationQueue queue)
          Constructs a Source of entities.
 
Method Summary
 boolean getStopped()
          This method returns the status of the Source.
 void run()
          The run method of Source.
 void start(java.util.LinkedList<Coroutine> liveEntity, Model env)
          This method starts the Source thread.
 void startEntity()
          Create and start a new entity (SimObject).
 void stop()
          This method stops the Source thread.
 
Methods inherited from class jsim.process.DynamicNode
getNodeStats, getOutgoing, getProps, setBatchProperties, setPrimary, setProps
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Source

public Source(Prop props,
              double stopTime,
              java.lang.String entityTName,
              Transport[] outgoing,
              AnimationQueue queue)
Constructs a Source of entities. This constructor has sufficient information to draw the node and its outgoing edges.

Parameters:
props - property of node
stopTime - stop at this time
maker - object to make client entities
outgoing - outgoing edges
queue - shared Queue for communication with animator

Source

public Source(int id,
              Prop props,
              double stopTime,
              java.lang.String entityTName,
              Transport[] outgoing,
              AnimationQueue queue)
Constructor which uses id Constructs a Source of entities. This constructor has sufficient information to draw the node and its outgoing edges.

Parameters:
id - id of the node
props - property of node
stopTime - stop at this time
maker - object to make client entities
outgoing - outgoing edges
queue - shared Queue for communication with animator

Source

public Source(Prop props,
              java.lang.String entityTName,
              Transport[] outgoing,
              AnimationQueue queue)
Constructs a Source of entities. This constructor has sufficient information to draw the node and its outgoing edges.

Parameters:
props - property of node
maker - object to make client entities
outgoing - outgoing edges

Source

public Source(int id,
              Prop props,
              java.lang.String entityTName,
              Transport[] outgoing,
              AnimationQueue queue)
Uses id for Animator Constructs a Source of entities. This constructor has sufficient information to draw the node and its outgoing edges.

Parameters:
id - id of the node
props - property of node
maker - object to make client entities
outgoing - outgoing edges
Method Detail

start

public void start(java.util.LinkedList<Coroutine> liveEntity,
                  Model env)
This method starts the Source thread.

Parameters:
liveEntity - list of live entities

stop

public void stop()
This method stops the Source thread.


getStopped

public boolean getStopped()
This method returns the status of the Source.

Returns:
boolean whether this source is stopped

startEntity

public void startEntity()
Create and start a new entity (SimObject). This can be done internally in the run method, or externally in response to a Java Beans event.


run

public void run()
The run method of Source. This determines the lifetime of the Source and the "create entity and sleep for some time" cycles.

Specified by:
run in interface java.lang.Runnable