BankModel

scalation.simulation.process.example_1.BankModel
class BankModel(name: String, reps: Int, animating: Boolean, aniRatio: Double, nStop: Int, stream: Int) extends Model

The BankModel class defines a simple process-interaction model of a bank where service is provided by one or more tellers. Caveat: must add 'from' and 'to' components before transport!!

Value parameters

aniRatio

the ratio of simulation speed vs. animation speed

animating

whether to animate the model

nStop

the number arrivals before stopping

name

the name of the simulation model

reps

the number of independent replications to run

stream

the base random number stream (0 to 999)

Attributes

Graph
Supertypes
class Model
trait Component
trait Locatable
trait Identifiable
trait Modelable
trait Completion
class Coroutine
trait Runnable
class Object
trait Matchable
class Any
Show all

Members list

Type members

Classlikes

case class Customer() extends SimActor

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class SimActor
trait Locatable
trait Ordered[SimActor]
trait Comparable[SimActor]
trait Temporal
trait Identifiable
class Coroutine
trait Runnable
class Object
trait Matchable
class Any
Show all

Value members

Inherited methods

def accum(value: Double): Unit

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
override def act(): Unit

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
Inherited from:
Model
def addComponent(_parts: Component*): Unit

Add component parts to the model.

Add component parts to the model.

Value parameters

_parts

the component parts

Attributes

Inherited from:
Model
def addComponents(_parts: List[Component]*): Unit

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

Inherited from:
Model
def aggregate(): Unit

Aggregate the statistics of this component's subparts.

Aggregate the statistics of this component's subparts.

Attributes

Inherited from:
Component
def animate(who: Identifiable, what: CommandType, color: Color, shape: Shape, from: Component, to: Component, at: Array[Double]): Unit

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

Inherited from:
Model
def animate(who: Identifiable, what: CommandType, color: Color, shape: Shape, at: Array[Double]): Unit

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

Inherited from:
Model
def at: Array[Double]

Get the location where this object is currently at.

Get the location where this object is currently at.

Attributes

Inherited from:
Locatable
def at_=(at: Array[Double]): Unit

Set the location of this object.

Set the location of this object.

Value parameters

at

the location of this object

Attributes

Inherited from:
Locatable
def cleanup(): Unit

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

Inherited from:
Model
def clock: Double

Return the current value of the director's clock.

Return the current value of the director's clock.

Attributes

Inherited from:
Modelable
def composite: Boolean

Indicate whether this component is composite, i.e., has subparts.

Indicate whether this component is composite, i.e., has subparts.

Attributes

Inherited from:
Component
def counts: (Int, Int, Int)

Return the Coroutine counts.

Return the Coroutine counts.

Attributes

Inherited from:
Coroutine

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
def director_=(director: Model): Unit

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
def display(): Unit

Put the components on the animation engine's queue.

Put the components on the animation engine's queue.

Attributes

Inherited from:
Model

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
override def equals(that: Any): Boolean

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
def getStatistics: ArrayBuffer[Statistic]

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

Inherited from:
Model
def hasFinished(): Unit

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
override def hashCode: Int

Return the hashCode as the unique id.

Return the hashCode as the unique id.

Attributes

Definition Classes
Identifiable -> Any
Inherited from:
Identifiable
def initComponent(label: String, loc: Array[Double]): Unit

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
protected def initStats(label: String): Unit

Initialize this component's statistical collectors. Sample statistics: all Components. Time-persistent statistics: all except Gate, Source and Sink.

Initialize this component's statistical collectors. Sample statistics: all Components. Time-persistent statistics: all except Gate, Source and Sink.

Value parameters

label

the name of this component

Attributes

Inherited from:
Component
def interrupt(): Unit

Interrupt this waiting coroutine.

Interrupt this waiting coroutine.

Attributes

Inherited from:
Coroutine
def isVirtual: Boolean

Check this thread to see if it is virtual.

Check this thread to see if it is virtual.

Attributes

Inherited from:
Coroutine
def me: String

Return the full identity.

Return the full identity.

Attributes

Inherited from:
Identifiable
def name_=(name: String): Unit

Set the name.

Set the name.

Value parameters

name

the name to assign

Attributes

Inherited from:
Identifiable
def orderedActor(actor1: SimActor): Ordered[SimActor]

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

Inherited from:
Model

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
def reschedule(actor: SimActor): Unit

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

Inherited from:
Model
def reset(): Unit

Reset the agenda and stateful components for next replication.

Reset the agenda and stateful components for next replication.

Attributes

Inherited from:
Model
def resetStart(): Unit

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
def resetStats(rep: Int, rmax: Int): Unit

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

Inherited from:
Model
def run(): Unit

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
def simType: String

Get the type of the simulation object.

Get the type of the simulation object.

Attributes

Inherited from:
Identifiable
def simulate(_startTime: Double): Unit

Execute the simulation (includes scheduling all Sources) returning summary statistics.

Execute the simulation (includes scheduling all Sources) returning summary statistics.

Attributes

Inherited from:
Model
def start(): Unit

Start this coroutine, i.e., invoke its 'run' -> 'act' method.

Start this coroutine, i.e., invoke its 'run' -> 'act' method.

Attributes

Inherited from:
Coroutine
def stopped: Boolean

Indicate whether the model has been stopped.

Indicate whether the model has been stopped.

Attributes

Inherited from:
Model
def tally(duration: Double): Unit

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

Return the current acting actor.

Return the current acting actor.

Attributes

Inherited from:
Model
def waitFinished(): Unit

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
def yyield(that: Coroutine, quit: Boolean): Unit

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

Concrete fields

val door: Sink
val entry: Source
val lambda: Double
val mu: Double
val nTellers: Int

Inherited fields

protected var _clock: Double

The clock that keep track of the current simulation time

The clock that keep track of the current simulation time

Attributes

Inherited from:
Modelable
val full: Boolean

Attributes

Inherited from:
Model
val id: Int

The globally unique integer identifier

The globally unique integer identifier

Attributes

Inherited from:
Identifiable
protected var simulating: Boolean

Simulation execution/termination flag

Simulation execution/termination flag

Attributes

Inherited from:
Modelable