Gate

scalation.simulation.agent.Gate
See theGate companion object
class Gate(name: String, director: Model, time: Double, line: WaitQueue, onTimeRV: Variate, offTimeRV: Variate, open0: Boolean, cap: Int, prop: Property, pos: VectorD) extends SimAgent, Statistical

The Gate class models the operation of gate that can open and closed. When the gate is open, entities can flow through and when closed, they cannot. They may wait in a queue or go elsewhere. A gate can model a traffic light (green => open, red => closed).

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

offTimeRV

distribution of time that gate will be closed

onTimeRV

distribution of time that gate will be open

open0

whether the gate is initially closed (false) or open (true)

pos

the position (Euclidean coordinates) of this gate

prop

the properties of this gate

time

the activation time for this gate

Attributes

Companion
object
Graph
Supertypes
trait Statistical
class SimAgent
trait Topological
trait Spatial
trait PartiallyOrdered[Spatial & Topological]
trait Temporal
trait Ordered[Temporal]
trait Comparable[Temporal]
trait Identifiable
class Coroutine
trait Runnable
class Object
trait Matchable
class Any
Show all

Members list

Type members

Inherited types

type AsPartiallyOrdered = Function1

Attributes

Inherited from:
PartiallyOrdered

Value members

Concrete methods

def act(): Unit

Specifies how the gate is controlled, cycling through open/green to closed/red.

Specifies how the gate is controlled, cycling through open/green to closed/red.

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

Toggles the value of open.

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 open(agent: SimAgent): Boolean

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

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

Attributes

def release(): Unit

Release the gate after service is finished and schedule the agents in the waiting queue up to cap.

Release the gate after service is finished and schedule the agents in the waiting queue up to cap.

Attributes

Inherited methods

def <[B >: Spatial & Topological : AsPartiallyOrdered](that: B): Boolean

Attributes

Inherited from:
PartiallyOrdered
def <(that: Temporal): Boolean

Attributes

Inherited from:
Ordered
def <=[B >: Spatial & Topological : AsPartiallyOrdered](that: B): Boolean

Attributes

Inherited from:
PartiallyOrdered
def <=(that: Temporal): Boolean

Attributes

Inherited from:
Ordered
def >[B >: Spatial & Topological : AsPartiallyOrdered](that: B): Boolean

Attributes

Inherited from:
PartiallyOrdered
def >(that: Temporal): Boolean

Attributes

Inherited from:
Ordered
def >=[B >: Spatial & Topological : AsPartiallyOrdered](that: B): Boolean

Attributes

Inherited from:
PartiallyOrdered
def >=(that: Temporal): Boolean

Attributes

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

Compare two temporal objects based on their time coordinate.

Compare two temporal objects based on their time coordinate.

Value parameters

other

the other item to compare with this item

Attributes

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

Attributes

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

Return the Coroutine counts.

Return the Coroutine counts.

Attributes

Inherited from:
Coroutine

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:
Statistical
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 findFore(d: Double): SimAgent

Find the SimAgent ahead (e.g., to follow). Must be nearest ahead in your element.

Find the SimAgent ahead (e.g., to follow). Must be nearest ahead in your element.

Value parameters

d

the maximum allowed distance to be considered in the neighborhood

Attributes

Inherited from:
SimAgent
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 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 neighbors(d: Double): ArrayBuffer[Topological]

Return the topological objects/tokens in the neighborhood of this token within distance d.

Return the topological objects/tokens in the neighborhood of this token within distance d.

Value parameters

d

the maximum allowed distance to be considered in the neighborhood

Attributes

Inherited from:
Topological
def neighbors: ArrayBuffer[Topological]

Return the topological objects/tokens in the neighborhood of this token.

Return the topological objects/tokens in the neighborhood of this token.

Attributes

Inherited from:
Topological

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:
Statistical
def r_rescale(factor: Double): Double

Rescale from actual-time (e.g., minutes) to animation-time (milliseconds).

Rescale from actual-time (e.g., minutes) to animation-time (milliseconds).

Value parameters

factor

the time rescaling factor

Attributes

Inherited from:
Temporal
def reorient(): Unit

Reorient the simulation agent behind when making a change (e.g., exit, turn or lane change).

Reorient the simulation agent behind when making a change (e.g., exit, turn or lane change).

Attributes

Inherited from:
SimAgent
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 s_rescale(factor: Double): VectorD

Rescale from actual-position (e.g., world-coordinates) to animation-position (screen-coordinates).

Rescale from actual-position (e.g., world-coordinates) to animation-position (screen-coordinates).

Value parameters

factor

the space rescaling factor

Attributes

Inherited from:
Spatial
def setPos(x: Double, y: Double): Unit

Set the initial position of this agent using the given x and y coordinates. Add half width and height to position center rather than top-left.

Set the initial position of this agent using the given x and y coordinates. Add half width and height to position center rather than top-left.

Value parameters

x

the x-coordinate

y

the y-coordinate

Attributes

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

Convert the simulation agent to a string.

Convert the simulation agent to a string.

Attributes

Definition Classes
Inherited from:
SimAgent
override def tryCompareTo[B >: SimAgent : AsPartiallyOrdered](other: B): Option[Int]

Compare two spatial objects based on their space coordinates.

Compare two spatial objects based on their space coordinates.

Value parameters

other

the other item to compare with this item

Attributes

Definition Classes
SimAgent -> Topological -> Spatial -> PartiallyOrdered
Inherited from:
SimAgent
def typeName: String

Get the type of the object.

Get the type of the object.

Attributes

Inherited from:
Identifiable
def updateLoc(distance: Double, edge: Edge): Unit

Update the location of this agent by moving distance units along the given edge.

Update the location of this agent by moving distance units along the given edge.

Value parameters

distance

the incremental distance to move along the edge

edge

the current edge (typically the same one it was on)

Attributes

Inherited from:
SimAgent
def updatePos(distance: Double, angle: Double): Unit

Update the position of this agent by moving distance units in the direction determined by the angle.

Update the position of this agent by moving distance units in the direction determined by the angle.

Value parameters

angle

the angle/direction to move in (0 radians => move right)

distance

the incremental distance to move

Attributes

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

Yield control TO the director so the director can take the next action. For efficiency, can yield THROUGH the director to the next agent, rather than TO the director itself. CURRENTLY ONLY THROUGH WORKS.

Yield control TO the director so the director can take the next action. For efficiency, can yield THROUGH the director to the next agent, rather than TO the director itself. CURRENTLY ONLY THROUGH WORKS.

Value parameters

quit

the flag indicating whether this agent is done

Attributes

Inherited from:
SimAgent
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 vert: Vertex

Inherited fields

var dist: Double

Attributes

Inherited from:
Topological
var elem: Element

Attributes

Inherited from:
Topological
val id: Int

Attributes

Inherited from:
Identifiable
var loc: (Element, Double)

Attributes

Inherited from:
SimAgent
var subtype: Int

Attributes

Inherited from:
SimAgent