The Model
class maintains a list of components making up the model and controls the flow of entities (SimActor
s) through the model, following the process-interaction world-view. It maintains a time-ordered priority queue to activate/re-activate each of the entities. Each entity (SimActor
) is implemented as a Coroutine
and may be thought of as running in its own thread.
Value parameters
- aniRatio
-
the ratio of simulation speed vs. animation speed
- animating
-
whether to animate the model
- full
-
generate a full report with both sample and time-persistent statistics
- height
-
the height of the animation panel
- name
-
the name of the simulation model
- reps
-
the number of independent replications to run
- width
-
the width of the animation panel
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait Componenttrait Locatabletrait Identifiabletrait Modelabletrait Completionclass Coroutinetrait Runnableclass Objecttrait Matchableclass AnyShow all
- Known subtypes
-
class BankModelclass CallCenterModelclass EmerDeptModelclass LoopModelclass MachineModelclass OneWayStreetModelclass OneWayVehicleModelclass RoadModelclass TrafficDynModelclass TrafficLaneChangeModelclass TrafficModelclass TrafficModelTurnclass UGA_BusModelclass BankModelclass Model_MBMclass BankModelShow all
Members list
Value members
Concrete methods
The model itself is an Actor (not an ordinary SimActor
) and may be thought of as the director. The director iteratively manages the clock and the agenda of actors until the simulation flag becomes false or the agenda (priority queue) becomes empty.
The model itself is an Actor (not an ordinary SimActor
) and may be thought of as the director. The director iteratively manages the clock and the agenda of actors until the simulation flag becomes false or the agenda (priority queue) becomes empty.
Attributes
- Definition Classes
Add component parts to the model.
Add component parts to the model.
Value parameters
- _parts
-
the component parts
Attributes
Add lists of component parts to the model.
Add lists of component parts to the model.
Value parameters
- _parts
-
the lists of component parts (need List rather than VEC)
Attributes
Put a node/token command on the animation queue.
Put a node/token command on the animation queue.
Value parameters
- at
-
the location of the node/token
- color
-
the color the node/token
- shape
-
the shape of the node/token
- what
-
what animation command
- who
-
who is being animated
Attributes
Put a edge command on the animation queue.
Put a edge command on the animation queue.
Value parameters
- at
-
the location of the edge (empty array => implicitly determined)
- color
-
the color the edge
- from
-
the location of the origination node
- shape
-
the shape of the edge
- to
-
the location of the destination node
- what
-
what animation command
- who
-
who is being animated
Attributes
Cleanup the agenda and any stateful components. Any actors left in the agenda or a wait queue must be terminated. The model (i.e., the director) must be terminated as well.
Cleanup the agenda and any stateful components. Any actors left in the agenda or a wait queue must be terminated. The model (i.e., the director) must be terminated as well.
Attributes
Put the components on the animation engine's queue.
Put the components on the animation engine's queue.
Attributes
Return the statistical results of the simulation (statistics for each part). This includes the sample/duration statistics and if 'full', time persistent statistics as well.
Return the statistical results of the simulation (statistics for each part). This includes the sample/duration statistics and if 'full', time persistent statistics as well.
Attributes
Compare the order of actors based on their 'actTime's.
Compare the order of actors based on their 'actTime's.
Value parameters
- actor1
-
the first actor in comparison
Attributes
Schedule (first time) or reschedule (subsequent times) an actor to act.
Schedule (first time) or reschedule (subsequent times) an actor to act.
Value parameters
- actor
-
the actor to be scheduled
Attributes
Reset the agenda and stateful components for next replication.
Reset the agenda and stateful components for next replication.
Attributes
Reset and aggregate all statistics.
Reset and aggregate all statistics.
Value parameters
- rep
-
the current replication (1, ... reps)
- rmax
-
the maximum number of replications/batches
Attributes
Execute the simulation (includes scheduling all Sources) returning summary statistics.
Execute the simulation (includes scheduling all Sources) returning summary statistics.
Attributes
Indicate whether the model has been stopped.
Indicate whether the model has been stopped.
Attributes
Inherited methods
Accumulate the value (e.g., number in queue) weighted by its time duration.
Accumulate the value (e.g., number in queue) weighted by its time duration.
Value parameters
- value
-
the value to accumulate
Attributes
- Inherited from:
- Component
Aggregate the statistics of this component's subparts.
Get the location where this object is currently at.
Set the location of this object.
Set the location of this object.
Value parameters
- at
-
the location of this object
Attributes
- Inherited from:
- Locatable
Return the current value of the director's clock.
Indicate whether this component is composite, i.e., has subparts.
Indicate whether this component is composite, i.e., has subparts.
Attributes
- Inherited from:
- Component
Return the Coroutine counts.
Get the director who controls the play/simulation this component is in.
Get the director who controls the play/simulation this component is in.
Attributes
- Inherited from:
- Component
Set this component's director (the controller of the simulation model).
Set this component's director (the controller of the simulation model).
Value parameters
- director
-
the director of the play/simulation
Attributes
- Inherited from:
- Component
Return sample statistics for durations for this component (e.g., Time in queue).
Return sample statistics for durations for this component (e.g., Time in queue).
Attributes
- Inherited from:
- Component
Determine whether Identifiable object 'this' equals Identifiable object 'that'. Works since 'id' is unique for all Identifiable objects.
Determine whether Identifiable object 'this' equals Identifiable object 'that'. Works since 'id' is unique for all Identifiable objects.
Attributes
- Definition Classes
-
Identifiable -> Any
- Inherited from:
- Identifiable
Signal via the semaphore that the simulation has finished, thereby ending the wait due to calling the waitFinished method.
Signal via the semaphore that the simulation has finished, thereby ending the wait due to calling the waitFinished method.
Attributes
- Inherited from:
- Completion
Return the hashCode as the unique id.
Return the hashCode as the unique id.
Attributes
- Definition Classes
-
Identifiable -> Any
- Inherited from:
- Identifiable
Initialize this component (all of its 'var's).
Initialize this component (all of its 'var's).
Value parameters
- label
-
the name of this component
- loc
-
the location of this component
Attributes
- Inherited from:
- Component
Initialize this component's statistical collectors. Sample statistics: all Component
s. Time-persistent statistics: all except Gate
, Source
and Sink
.
Initialize this component's statistical collectors. Sample statistics: all Component
s. Time-persistent statistics: all except Gate
, Source
and Sink
.
Value parameters
- label
-
the name of this component
Attributes
- Inherited from:
- Component
Interrupt this waiting coroutine.
Check this thread to see if it is virtual.
Return the full identity.
Set the name.
Return time persistent statistics for value for this component (e.g. Number in queue).
Return time persistent statistics for value for this component (e.g. Number in queue).
Attributes
- Inherited from:
- Component
For multiple sources and more than one replication otherwise, after one replication, all the sources are already started the first source from agenda will be invoked by the yield to null but the second resource from the won't so needs to be reset
For multiple sources and more than one replication otherwise, after one replication, all the sources are already started the first source from agenda will be invoked by the yield to null but the second resource from the won't so needs to be reset
Attributes
- Inherited from:
- Coroutine
Thread's 'run' method delegates to the 'act' method. Upon interruption the 'act' method is run again from the beginning.
Thread's 'run' method delegates to the 'act' method. Upon interruption the 'act' method is run again from the beginning.
Attributes
- Inherited from:
- Coroutine
Get the type of the simulation object.
Start this coroutine, i.e., invoke its 'run' -> 'act' method.
Tally the duration (e.g., waiting time) of an activity or delay.
Tally the duration (e.g., waiting time) of an activity or delay.
Value parameters
- duration
-
the time duration
Attributes
- Inherited from:
- Component
Wait for the main simulation Thread/Coroutine to complete. This can used used to time execution of models.
Wait for the main simulation Thread/Coroutine to complete. This can used used to time execution of models.
Attributes
- See also
-
apps.process.Bank2
- Inherited from:
- Completion
Yield control from 'this' to 'that' coroutine.
Yield control from 'this' to 'that' coroutine.
Value parameters
- quit
-
whether 'this' coroutine is to terminate (true) or wait to be resumed (false)
- that
-
the other coroutine to yield control to
Attributes
- Inherited from:
- Coroutine
Inherited fields
The clock that keep track of the current simulation time
The globally unique integer identifier
Simulation execution/termination flag