|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuchicago.src.sim.engine.BasicAction
uchicago.src.sim.engine.ActionGroup
public class ActionGroup
A collection of BasicActions to be executed by a schedule. An ActionGroup has no notion of time. All the BasicActions added to an ActionGroup execute during the same simulation clock tick. The BasicActions in the ActionGroup can be executed sequentialy in the order they were added or randomly. An ActionGroup is added to a Schedule which can then execute the Group and in doing so execute the BasicActions within the ActionGroup at some specified simulation clock tick.
Schedule,
BasicAction| Field Summary | |
|---|---|
static int |
RANDOM
Random type |
static int |
SEQUENTIAL
Sequential type |
| Fields inherited from class uchicago.src.sim.engine.BasicAction |
|---|
INTERVAL_UPDATER, ONE_TIME_UPDATER, updater |
| Constructor Summary | |
|---|---|
ActionGroup()
Constructs an ActionGroup with a default sequential execution. |
|
ActionGroup(int type)
Constructs an ActionGroup with execution of the specified type. |
|
| Method Summary | |
|---|---|
void |
addAction(BasicAction action)
Adds a BasicAction to the list of BasicActions to execute. |
void |
createActionFor(java.lang.Object o,
java.lang.String methodName)
Creates a BasicAction consisting of the specified method to be called on the specified object, and adds the action to this ActionGroup. |
void |
createActionForEach(java.util.ArrayList list,
java.lang.Class superClass,
java.lang.String methodName)
Creates a BasicAction consisting of the specified method to be called on every Object in the specified list, and adds the BasicAction to this ActionGroup. |
void |
createActionForEach(java.util.ArrayList list,
java.lang.String methodName)
Creates a BasicAction consisting of the specified method to be called on every object in the specified list, and adds the action to this ActionGroup. |
void |
execute()
Executes the BasicActions contained by this ActionGroup. |
int |
getType()
Gets the type (ActionGroup.SEQUENTIAL or ActionGroup.RANDOM) of this ActionGroup. |
void |
removeAction(BasicAction action)
Removes the specified BasicAction from the group. |
void |
setRng(cern.jet.random.Uniform rng)
Sets the random number generator used by this ActionGroup when randomizing the BasicActions to execute. |
| Methods inherited from class uchicago.src.sim.engine.BasicAction |
|---|
addToGroup, getIntervalTime, getName, getNextTime, reSchedule, setIntervalTime, setName, setNextTime |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int SEQUENTIAL
public static final int RANDOM
| Constructor Detail |
|---|
public ActionGroup()
public ActionGroup(int type)
type - the type (Sequential or Random) of ActionGroup to construct.
Type can be specified by the constants ActionGroup.SEQUENTIAL and
ActionGroup.RANDOM.| Method Detail |
|---|
public int getType()
public void setRng(cern.jet.random.Uniform rng)
public void execute()
execute in class BasicAction
public void createActionFor(java.lang.Object o,
java.lang.String methodName)
o - the object to the call the method on.methodName - the name of the method to call. The method should take
no arguments
public void createActionForEach(java.util.ArrayList list,
java.lang.String methodName)
throws java.lang.NoSuchMethodException
list - the list containing the object to call the method onmethodName - the name of the method to call. The method should take
no arguments
java.lang.NoSuchMethodException - if the first object in the list does not have
the specified method.
public void createActionForEach(java.util.ArrayList list,
java.lang.Class superClass,
java.lang.String methodName)
throws java.lang.NoSuchMethodException
list - the list containing the object to call the method onsuperClass - the class to use when creating the BasicAction.methodName - the name of the method to call. The method should take
no arguments
java.lang.NoSuchMethodException - if the first object in the list does not have
the specified method.public void addAction(BasicAction action)
action - the BasicAction to addpublic void removeAction(BasicAction action)
action - the BasicAction to remove
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||