The Component
trait provides basic common feature for simulation components.
The Component
trait provides basic common feature for simulation components.
The list of subparts is empty for atomic components and nonempty for
composite components.
The Coroutine
class supports (one-at-a-time) quasi-concurrent programming.
The Coroutine
class supports (one-at-a-time) quasi-concurrent programming.
A coroutine runs/acts until it yields control from 'this' to 'that' coroutine.
When resumed, a coroutines continues its execution where it left off.
When a coroutine finishes, it may be terminated or zombified, in which case
it may be restarted.
The CoroutineA
class supports quasi-concurrent programming.
The CoroutineA
class supports quasi-concurrent programming. A coroutine
runs/acts until it yields control to some other coroutine. When resumed,
a coroutines continues execution where it left off.
The CoroutineK
class supports quasi-concurrent programming.
The CoroutineK
class supports quasi-concurrent programming. A coroutine
runs/acts until it yields control to some other coroutine. When resumed,
a coroutines continues execution where it left off.
The Gate
class models the operation of gate that can open and shut.
The Gate
class models the operation of gate that can open and shut.
When the gate is open, entities can flow through and when shut, they
cannot. They may wait in a queue or go elsewhere. A gate can model
a traffic light (green => open, red => shut).
The Junction
class provides a connector between two Transport
s/Route
s.
The Junction
class provides a connector between two Transport
s/Route
s.
Since Lines
and QCurves
have limitations (e.g., hard to make a loop back),
a junction may be needed.
The Model
class maintains a list of components making up the model and
controls the flow of entities (SimActors) through the model, following the
process-interaction world-view.
The Model
class maintains a list of components making up the model and
controls the flow of entities (SimActors) 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
implemeneted as a Scala Actor and may be thought of as running in its own thread.
The Resource
class provides services to entities (SimActors
).
The Resource
class provides services to entities (SimActors
).
It may or may not have an associated waiting queue.
The Route
class provides a multilane pathway between two other components.
The Route
class provides a multilane pathway between two other components.
The components in a Model
conceptually form a graph in which the edges
are Transport
s and the nodes are other Component
s.
A Route
is a composite component that bundles several Transport
s.
The SimActor
abstract class represents entities that are active in the model.
The SimActor
abstract class represents entities that are active in the model.
The 'act' abstract method, which specifies entity behavior, must be defined
for each subclass. Each SimActor
extends Scala's Actor
class and may be
roughly thought of as running in its own thread.
The Sink
class is used to terminate entities (SimActors) when they are finished.
The Source
class is used to periodically inject entities (SimActors
) into a
running simulation model.
The Source
class is used to periodically inject entities (SimActors
) into a
running simulation model. May act as an arrival generator. Source is both
a simulation Component
and special SimActor
and therefore runs in own thread.
The Transport
class provides a pathway between two other components.
The Transport
class provides a pathway between two other components.
The components in a Model
conceptually form a 'graph' in which the 'edges'
are Transport
s and the 'nodes' are other Component
s.
The WaitQueue
class is a wrapper for Scala's Queue class, which supports
FCSC Queues.
The WaitQueue
class is a wrapper for Scala's Queue class, which supports
FCSC Queues. It adds monitoring capabilities and optional capacity restrictions.
If the queue is full, entities (SimActor
s) attempting to enter the queue
are 'barred'. At the model level, such entities may be (1) held in place,
(2) take an alternate route, or (3) be lost (e.g., dropped call/packet).
The Coroutine
companion object provides counters for the Coroutine
class.
The CoroutineATest
object is used to test the CoroutineA
class.
The CoroutineATest
object is used to test the CoroutineA
class.
Should print:
Cor1: phase 1
Cor2: phase 1
Cor1: phase 2
Cor2: phase 2
The CoroutineKTest
object is used to test the CoroutineK
class.
The CoroutineKTest
object is used to test the CoroutineK
class.
Should print: FIX: execution order and completeness is indeterminate
Cor1: phase 1
Cor2: phase 1
Cor1: phase 2
Cor2: phase 2
The CoroutineTest
object is used to test the Coroutine
class.
The CoroutineTest
object is used to test the Coroutine
class.
Should print:
Cor1: phase 1
Cor2: phase 1
Cor1: phase 2
Cor2: phase 2
The Gate
companion object provides a builder method for gates.
The Junction
companion object provides a builder method for sinks.
The ModelTest
object is used to test the Model
class.
The ModelTest
object is used to test the Model
class.
Caveat: must add 'from' and 'to' components before transport!!
The Resource
companion object provides a builder method for resources.
The RouteTest
object is used to test the Route
class, which is a composite
class.
The RouteTest
object is used to test the Route
class, which is a composite
class. It simulates a two-lane road in one direction.
The Sink
companion object provides a builder method for sinks.
The Source
companion object provides a builder method for sources.
The WaitQueue
companion object provides a builder method for wait-queues.
The process package contains classes, traits and objects for process-oriented simulation models (for example, process-interaction).