Resource

scalation.simulation.process.Resource
See theResource companion object
class Resource(name: String, line: WaitQueue, var units: Int, serviceTime: Variate, at: Array[Double]) extends Component

The Resource class provides services to entities (SimActors). It may or may not have an associated waiting queue.

Value parameters

at

the location of the resource (x, y, w, h)

line

the line/queue where entities wait

name

the name of the resource

serviceTime

the service time distribution

units

the number of service units (e.g., bank tellers)

Attributes

Companion
object
Graph
Supertypes
trait Component
trait Locatable
trait Identifiable
class Object
trait Matchable
class Any
Show all

Members list

Value members

Constructors

def this(name: String, line: WaitQueue, units: Int, serviceTime: Variate, xy: (Double, Double))

Auxiliary constructor that uses defaults for width 'w' and height 'h'.

Auxiliary constructor that uses defaults for width 'w' and height 'h'.

Value parameters

line

the line/queue where entities wait

name

the name of the resource

serviceTime

the service time distribution

units

the number of service units (e.g., bank tellers)

xy

the (x, y) coordinates for the top-left corner of the resource.

Attributes

Concrete methods

def busy: Boolean

Determine whether this resource is busy (no units available).

Determine whether this resource is busy (no units available).

Attributes

def changeUnits(dUnits: Int): Unit

Change the number of units in this resource (e.g., add a teller).

Change the number of units in this resource (e.g., add a teller).

Value parameters

dUnits

the number of units to add (+ve) or remove (-ve)

Attributes

def display(): Unit

Tell the animation engine to display this resource.

Tell the animation engine to display this resource.

Attributes

def release(): Unit

Release this resource after service is finished (also check wait-queue).

Release this resource after service is finished (also check wait-queue).

Attributes

def utilize(): Unit

Utilize this resource for a period of time (models an activity). The duration (service time) is randomly generated according to the resource's service time distribution.

Utilize this resource for a period of time (models an activity). The duration (service time) is randomly generated according to the resource's service time distribution.

Attributes

def utilize(duration: Double): Unit

Utilize this resource for a given period of time (models an activity).

Utilize this resource for a given period of time (models an activity).

Value parameters

duration

the given service time

Attributes

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

Aggregate the statistics of this component's subparts.

Aggregate the statistics of this component's subparts.

Attributes

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

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

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

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

Get the type of the simulation object.

Get the type of the simulation object.

Attributes

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

Inherited fields

val id: Int

The globally unique integer identifier

The globally unique integer identifier

Attributes

Inherited from:
Identifiable