BankModel2

scalation.simulation.event.example_1.BankModel2
class BankModel2(lambda: Double, mu: Double, name: String, reps: Int, nStop: Int, stream: Int) extends Model

The BankModel2 class defines a simple Event-Scheduling model of a Bank where service is provided by one teller and models an M/M/1 queue.

Value parameters

lambda

the customer arrival rate (per hr)

mu

the customer service rate (per hr)

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 Identifiable
trait Modelable
class Object
trait Matchable
class Any
Show all

Members list

Type members

Classlikes

case class Arrival(customer: Entity, delay: Double) extends Event

Arrival is a subclass of Event for handling arrival events. The 'occur' method triggers future events and updates the current state.

Arrival is a subclass of Event for handling arrival events. The 'occur' method triggers future events and updates the current state.

Value parameters

customer

the entity that arrives, in this case a bank customer

delay

the time delay for this event's occurrence

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Event
trait Ordered[Event]
trait Comparable[Event]
trait Identifiable
class Object
trait Matchable
class Any
Show all
case class Departure(customer: Entity, delay: Double) extends Event

Departure is a subclass of Event for handling departure events. The 'occur' method triggers future events and updates the current state.

Departure is a subclass of Event for handling departure events. The 'occur' method triggers future events and updates the current state.

Value parameters

customer

the entity that departs, in this case a bank customer

delay

the time delay for this event's occurrence

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Event
trait Ordered[Event]
trait Comparable[Event]
trait Identifiable
class Object
trait Matchable
class Any
Show all

Value members

Inherited methods

def addStats(stat: Statistic*): Unit

Add statistical collector to the model.

Add statistical collector to the model.

Value parameters

stat

one or more statistical collectors

Attributes

Inherited from:
Model
def animate(who: Identifiable, what: CommandType, color: Color, shape: Shape, from: Event, to: Event, 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 cancel(event: Event): Unit

Cancel the specified 'event' so it will not occur.

Cancel the specified 'event' so it will not occur.

Value parameters

event

the event to cancel

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
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: ListBuffer[Statistic]

Return the statistical results of the simulation (statistics for each part).

Return the statistical results of the simulation (statistics for each part).

Attributes

Inherited from:
Model
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 leave(entity: Entity): Unit

Leave the model recording the entity's time in the sYstem.

Leave the model recording the entity's time in the sYstem.

Value parameters

entity

the entity leaving the model

Attributes

Inherited from:
Model
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 report(vars: (String, Double)*): Unit

Report values of the specified model result/output variables.

Report values of the specified model result/output variables.

Value parameters

vars

the result/output variables for the simulation

Attributes

Inherited from:
Model
def reportStats(): Unit

Report statistical results of the simulation for all the collectors.

Report statistical results of the simulation for all the collectors.

Attributes

Inherited from:
Model
def schedule(event: Event): Unit

Place an event on the Future Event List 'FEL' for later execution, thus scheduling the event to occur sometime in the future. Events are ordered by their event/act time.

Place an event on the Future Event List 'FEL' for later execution, thus scheduling the event to occur sometime in the future. Events are ordered by their event/act time.

Value parameters

event

the event to schedule

Attributes

Inherited from:
Model
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

Run the simulation by iteratively processing events in time order. Requires at least one to already be scheduled (see next method).

Run the simulation by iteratively processing events in time order. Requires at least one to already be scheduled (see next method).

Value parameters

startTime

the time at which the simulation is to begin

Attributes

Inherited from:
Model

Concrete fields

val mm1: MM1_Queue
var nArr: Double
var nIn: Double
var nOut: Double

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 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