class Gate extends SimActor with 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).
- Alphabetic
- By Inheritance
- Gate
- Component
- SimActor
- Locatable
- Ordered
- Comparable
- PQItem
- Identifiable
- Coroutine
- Error
- Runnable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Gate(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'.
- name
the name of the gate
- director
the model/container for this gate
- line
the queue holding entities waiting for this gate to open
- units
number of units/phases of operation
- onTime
distribution of time that gate will be open
- offTime
distribution of time that gate will be closed
- xy
the (x, y) coordinates for the top-left corner of the sink.
- shut0
Boolean
indicating if the gate is initially opened or closed- cap
the maximum number of entities that will be released when the gate is opened
- new Gate(name: String, director: Model, line: WaitQueue, units: Int, onTime: Variate, offTime: Variate, loc: Array[Double], shut0: Boolean = false, cap: Int = 10)
- name
the name of the gate
- director
the model/container for this gate
- line
the queue holding entities waiting for this gate to open
- units
number of units/phases of operation
- onTime
distribution of time that gate will be open
- offTime
distribution of time that gate will be closed
- loc
the location of the Gate (x, y, w, h)
- shut0
Boolean
indicating if the gate is initially opened or closed- cap
the maximum number of entities that will be released when the gate is opened
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def <(that: SimActor): Boolean
- Definition Classes
- Ordered
- def <=(that: SimActor): Boolean
- Definition Classes
- Ordered
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def >(that: SimActor): Boolean
- Definition Classes
- Ordered
- def >=(that: SimActor): Boolean
- Definition Classes
- Ordered
- val DIAM: Double
Diameter of a token (for animating entities)
Diameter of a token (for animating entities)
- Definition Classes
- Component
- val RAD: Double
Radius of a token (for animating entities)
Radius of a token (for animating entities)
- Definition Classes
- Component
- 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
the value to accumulate
- Definition Classes
- Component
- def act(): Unit
Specifies how the gate is controlled.
- val actTime: Double
- Definition Classes
- PQItem
- def aggregate(): Unit
Aggregate the statistics of this component's subparts.
Aggregate the statistics of this component's subparts.
- Definition Classes
- Component
- var arrivalT: Double
The time at which 'this' entity (
SimActor
) arrivedThe time at which 'this' entity (
SimActor
) arrived- Definition Classes
- SimActor
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def at: Array[Double]
- Definition Classes
- Locatable
- def at_=(at: Array[Double]): Unit
- Definition Classes
- Locatable
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- def compare(actor2: SimActor): Int
Compare the activation times of the two actors, 'this' and 'actor2'.
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).
- actor2
the other actor to compare with this
- Definition Classes
- SimActor → Ordered
- def compare(other: PQItem): Int
- Definition Classes
- PQItem
- def compareTo(that: SimActor): Int
- Definition Classes
- Ordered → Comparable
- def composite: Boolean
Indicate whether this component is composite, i.e., has subparts.
Indicate whether this component is composite, i.e., has subparts.
- Definition Classes
- Component
- def counts: (Int, Int, Int)
Return the Coroutine counts.
Return the Coroutine counts.
- Definition Classes
- Coroutine
- def director: Model
Get the director who controls the play/simulation this component is in.
Get the director who controls the play/simulation this component is in.
- Definition Classes
- 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).
- director
the director of the play/simulation
- Definition Classes
- Component
- def display(): Unit
Tell the animation engine to display this Gate.
- 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
- def durationStat: Statistic
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).
- Definition Classes
- Component
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(that: Any): Boolean
- Definition Classes
- Identifiable → AnyRef → Any
- final def flaw(method: String, message: String): Unit
- Definition Classes
- Error
- def flip(): Unit
Toggles the value of shut.
- def gateColor: Color
Return the current color of the gate which indicates (within the animation) whether the gate is open or closed.
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- Identifiable → AnyRef → Any
- val id: Int
- Definition Classes
- 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).
- label
the name of this component
- loc
the location of this component
- Definition Classes
- Component
- def initStats(label: String): Unit
Initialize this component's statistical collectors.
Initialize this component's statistical collectors. Sample statistics: all
Component
s. Time-persistent statistics: all exceptGate
,Source
andSink
.- label
the name of this component
- Definition Classes
- Component
- def interrupt(): Unit
Interrupt this waiting coroutine.
Interrupt this waiting coroutine.
- Definition Classes
- Coroutine
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def me: String
- Definition Classes
- Identifiable
- var mySource: Source
The indicator of subtype of 'this' entity (
SimActor
)The indicator of subtype of 'this' entity (
SimActor
)- Definition Classes
- SimActor
- def name: String
- Definition Classes
- Identifiable
- def name_=(name: String): Unit
- Definition Classes
- Identifiable
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def persistentStat: TimeStatistic
Return time persistent statistics for value for this component (e.g.
Return time persistent statistics for value for this component (e.g. Number in queue).
- Definition Classes
- Component
- def release(): Unit
Release the Gate after service is finished (also check waiting queue).
- def run(): Unit
Thread's 'run' method delegates to the 'act' method.
Thread's 'run' method delegates to the 'act' method. Upon interruption the 'act' method is run again from the beginning.
- Definition Classes
- Coroutine → Runnable
- 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.- delay
the time delay before reactivation
- Definition Classes
- SimActor
- def shut: Boolean
Return whether the gate is shut (e.g., traffic light is red).
- def simType: String
- Definition Classes
- Identifiable
- def start(): Future[_]
Start this coroutine, i.e., invoke its 'run' -> 'act' method.
Start this coroutine, i.e., invoke its 'run' -> 'act' method. This function returns a future.
- Definition Classes
- Coroutine
- val subpart: ListBuffer[Component]
List of subparts of the Component (empty for atomic components, nonempty for composites)
List of subparts of the Component (empty for atomic components, nonempty for composites)
- Definition Classes
- Component
- var subtype: Int
The indicator of subtype of 'this' entity (
SimActor
)The indicator of subtype of 'this' entity (
SimActor
)- Definition Classes
- SimActor
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- 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.
- duration
the time duration
- Definition Classes
- Component
- def toString(): String
Show the
SimActor
s full name and activation time.Show the
SimActor
s full name and activation time.- Definition Classes
- SimActor → PQItem → AnyRef → Any
- def trajectory: Double
Get the current trajectory (along the
QCurve
) of 'this'SimActor
.Get the current trajectory (along the
QCurve
) of 'this'SimActor
.- Definition Classes
- 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
.- Definition Classes
- SimActor
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- def yieldToDirector(quit: Boolean = false): 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.
- quit
the flag indicating whether this actor is done
- Definition Classes
- SimActor
- def yyield(that: Coroutine, quit: Boolean = false): Unit
Yield control from 'this' to 'that' coroutine.
Yield control from 'this' to 'that' coroutine.
- that
the other coroutine to yield control to
- quit
whether 'this' coroutine is to terminate (true) or wait to be resumed (false)
- Definition Classes
- Coroutine
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated