Gate

scalation.simulation.process.Gate
See theGate companion object
class Gate(name: String, director: Model, line: WaitQueue, units: Int, onTime: Variate, offTime: Variate, loc: Array[Double], shut0: Boolean, cap: Int) extends SimActor, Component

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

Value parameters

cap

the maximum number of entities that will be released when the gate is opened

director

the model/container for this gate

line

the queue holding entities waiting for this gate to open

loc

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

name

the name of the gate

offTime

distribution of time that gate will be closed

onTime

distribution of time that gate will be open

shut0

Boolean indicating if the gate is initially opened or closed

units

number of units/phases of operation

Attributes

Companion
object
Graph
Supertypes
trait Component
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

Members list

Value members

Constructors

def this(name: String, director: Model, line: WaitQueue, units: Int, onTime: Variate, offTime: Variate, xy: (Double, Double), shut0: Boolean, cap: Int)

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

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

Value parameters

cap

the maximum number of entities that will be released when the gate is opened

director

the model/container for this gate

line

the queue holding entities waiting for this gate to open

name

the name of the gate

offTime

distribution of time that gate will be closed

onTime

distribution of time that gate will be open

shut0

Boolean indicating if the gate is initially opened or closed

units

number of units/phases of operation

xy

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

Attributes

Concrete methods

override def act(): Unit

Specifies how the gate is controlled.

Specifies how the gate is controlled.

Attributes

Definition Classes
def display(): Unit

Tell the animation engine to display this Gate.

Tell the animation engine to display this Gate.

Attributes

def duration: Double

Returns a Double for the amount of time the gate should stay open or closed based on whether or not the gate is open or closed

Returns a Double for the amount of time the gate should stay open or closed based on whether or not the gate is open or closed

Attributes

def flip(): Unit

Toggles the value of shut.

Toggles the value of shut.

Attributes

Return the current color of the gate which indicates (within the animation) whether the gate is open or closed.

Return the current color of the gate which indicates (within the animation) whether the gate is open or closed.

Attributes

def release(): Unit

Release the Gate after service is finished (also check waiting queue).

Release the Gate after service is finished (also check waiting queue).

Attributes

def shut: Boolean

Return whether the gate is shut (e.g., traffic light is red).

Return whether the gate is shut (e.g., traffic light is red).

Attributes

Inherited methods

def <(that: SimActor): Boolean

Attributes

Inherited from:
Ordered
def <=(that: SimActor): Boolean

Attributes

Inherited from:
Ordered
def >(that: SimActor): Boolean

Attributes

Inherited from:
Ordered
def >=(that: SimActor): Boolean

Attributes

Inherited from:
Ordered
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: 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 compare(actor2: SimActor): Int

Compare the activation times of the two actors, this and actor2. Their activation times are used to order them in the director's agenda (a time-based priority queue).

Compare the activation times of the two actors, this and actor2. Their activation times are used to order them in the director's agenda (a time-based priority queue).

Value parameters

actor2

the other actor to compare with this

Attributes

Inherited from:
SimActor
def compare(other: Temporal): Int

Compare two temporal objects based on their actTime.

Compare two temporal objects based on their actTime.

Value parameters

other

the other item to compare with this item

Attributes

Inherited from:
Temporal
def compareTo(that: SimActor): Int

Attributes

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

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 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 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 schedule(delay: Double): Unit

Schedule a reactivation of this SimActor delay time units in the future.

Schedule a reactivation of this SimActor delay time units in the future.

Value parameters

delay

the time delay before reactivation

Attributes

Inherited from:
SimActor
def simType: String

Get the type of the simulation object.

Get the type of the simulation object.

Attributes

Inherited from:
Identifiable
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 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
override def toString: String

Show the SimActors full name and activation time.

Show the SimActors full name and activation time.

Attributes

Definition Classes
SimActor -> Temporal -> Any
Inherited from:
SimActor
def trajectory: Double

Get the current trajectory (along the QCurve) of this SimActor.

Get the current trajectory (along the QCurve) of this SimActor.

Attributes

Inherited from:
SimActor
def trajectory_=(trajectory: Double): Unit

Set the value of the trajectory along the QCurve for this SimActor.

Set the value of the trajectory along the QCurve for this SimActor.

Value parameters

t

the new trajectory for the SimActor

Attributes

Inherited from:
SimActor
def yieldToDirector(quit: Boolean): Unit

Yield control to the director so the director can take the next action.

Yield control to the director so the director can take the next action.

Value parameters

quit

the flag indicating whether this actor is done

Attributes

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

Inherited fields

var actTime: Double

The activation time for the temporal object

The activation time for the temporal object

Attributes

Inherited from:
Temporal
val id: Int

The globally unique integer identifier

The globally unique integer identifier

Attributes

Inherited from:
Identifiable

Attributes

Inherited from:
SimActor
val prop: Map[String, Double]

Attributes

Inherited from:
SimActor
var subtype: Int

Attributes

Inherited from:
SimActor