Transition

scalation.simulation.activity.Transition
class Transition(val x: Double, val y: Double, firingDist: Variate, colors: Array[Color]) extends Temporal, Ordered[Transition], PetriNetRules, Identifiable

The Transition class represents a timed transition.

Value parameters

colors

the colors of the tokens (needed for firing rules)

firingDist

the random variate for the firing distribution

x

the x-coordinate for 'this' transition

y

the y-coordinate for 'this' transition

Attributes

Graph
Supertypes
trait Ordered[Transition]
trait Comparable[Transition]
trait Temporal
trait Identifiable
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def addFluids(_fluids: VectorD): Unit

Add fluids to 'this' transition.

Add fluids to 'this' transition.

Value parameters

_fluids

the fluid vector to add

Attributes

def addTokens(_tokens: VectorI): Unit

Add tokens to 'this' transition.

Add tokens to 'this' transition.

Value parameters

_token

the token vector to add

Attributes

def checkGuard: Boolean

Check the incoming arcs from discrete place for enough tokens of the right colors and the incoming arcs from continuous places for enough fluid of the right colors.

Check the incoming arcs from discrete place for enough tokens of the right colors and the incoming arcs from continuous places for enough fluid of the right colors.

Attributes

def compare(tr2: Transition): Int

Compare 'this' transition to 'tr2' based on firing time.

Compare 'this' transition to 'tr2' based on firing time.

Value parameters

tr2

the other transition

Attributes

def connect(_pnet: PetriNet, _in: Array[ArcI], _out: Array[ArcI]): Unit

Connect 'this' transition to all the incoming and outgoing discrete arcs as well as the containing Petri net.

Connect 'this' transition to all the incoming and outgoing discrete arcs as well as the containing Petri net.

Value parameters

_in

the incoming arcs from discrete/Int places

_out

the outgoing arcs to discrete/Int places

_pnet

the containing Petri net

Attributes

def connect(_pnet: PetriNet, _in: Array[ArcD], _out: Array[ArcD]): Unit

Connect 'this' transition to all the incoming and outgoing continuous arcs as well as the containing Petri net.

Connect 'this' transition to all the incoming and outgoing continuous arcs as well as the containing Petri net.

Value parameters

_in

the incoming arcs from continuous/Double places

_out

the outgoing arcs to continuous/Double places

_pnet

the containing Petri net

Attributes

def connect(_pnet: PetriNet, _inI: Array[ArcI], _inD: Array[ArcD], _outI: Array[ArcI], _outD: Array[ArcD]): Unit

Connect 'this' transition to all the incoming and outgoing arcs as well as the containing Petri net.

Connect 'this' transition to all the incoming and outgoing arcs as well as the containing Petri net.

Value parameters

_inD

the incoming arcs from continuous/Double places

_inI

the incoming arcs from discrete/Int places

_outD

the outgoing arcs to continuous/Double places

_outI

the outgoing arcs to discrete/Int places

_pnet

the containing Petri net

Attributes

def enable(): Double

Enable 'this' transition by computing the firing delay. Should immediately place it on the time ordered firing list. Also, move tokens/fluids from input places to 'this' transition.

Enable 'this' transition by computing the firing delay. Should immediately place it on the time ordered firing list. Also, move tokens/fluids from input places to 'this' transition.

Attributes

def fire(): Unit

Fire 'this' transition by moving the requisite number and color of tokens from 'this' transition to each outgoing discrete place and the requisite amount and color of fluid to each outgoing continuous place.

Fire 'this' transition by moving the requisite number and color of tokens from 'this' transition to each outgoing discrete place and the requisite amount and color of fluid to each outgoing continuous place.

Attributes

def takeFluids(_fluids: VectorD): Unit

Take fluids from 'this' transition.

Take fluids from 'this' transition.

Value parameters

_fluids

the fluid vector to take away

Attributes

def takeTokens(_tokens: VectorI): Unit

Take tokens from 'this' transition.

Take tokens from 'this' transition.

Value parameters

_token

the token vector to take away

Attributes

Inherited methods

def <(that: Transition): Boolean

Attributes

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

Attributes

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

Attributes

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

Attributes

Inherited from:
Ordered
def calcFiringDelay(v: Variate, w_t: VectorD, t: VectorI, w_f: VectorD, f: VectorD): Double

Function to compute the delay in firing a transition. The base time is given by a random variate. This is adjusted by weight vectors multiplying the number of aggregate tokens and the aggregate amount of fluids summed over all input places: delay = v + w_t * t + w_f * f.

Function to compute the delay in firing a transition. The base time is given by a random variate. This is adjusted by weight vectors multiplying the number of aggregate tokens and the aggregate amount of fluids summed over all input places: delay = v + w_t * t + w_f * f.

Value parameters

f

the aggregate fluid level vector (summed over all input places)

t

the aggregate token vector (summed over all input places)

v

the random variate used to compute base firing time

w_f

the weight for the fluid vector

w_t

the weight for the token vector

Attributes

Inherited from:
PetriNetRules
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: Transition): Int

Attributes

Inherited from:
Ordered
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 fluidFlow(f: VectorD, derv: Array[Derivative], t0: Double, d: Double): VectorD

Compute the amount of fluid to flow over an arc according to the system of first-order Ordinary Differential Equation 'ODE's: "integral 'derv' from t0 to t". Supports ODE base flow models.

Compute the amount of fluid to flow over an arc according to the system of first-order Ordinary Differential Equation 'ODE's: "integral 'derv' from t0 to t". Supports ODE base flow models.

Value parameters

d

the time delay

derv

the array of derivative functions

f

the fluid vector (amount of fluid per color)

t0

the current time

Attributes

Inherited from:
PetriNetRules
def fluidFlow(f: VectorD, b: VectorD, r: VectorD, d: Double): VectorD

Compute the amount of fluid to flow over an arc according to the vector expression: b + r * (f-b) * d. If r is 0, returns b. Supports linear (w.r.t. time delay) and constant (d == 0) flow models.

Compute the amount of fluid to flow over an arc according to the vector expression: b + r * (f-b) * d. If r is 0, returns b. Supports linear (w.r.t. time delay) and constant (d == 0) flow models.

Value parameters

b

the constant vector for base fluid flow

d

the time delay

f

the fluid vector (amount of fluid per color)

r

the rate vector (amounts of fluids per unit time)

Attributes

Inherited from:
PetriNetRules
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 me: String

Return the full identity.

Return the full identity.

Attributes

Inherited from:
Identifiable
def name: String

Get the name.

Get the name.

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

Get the type of the simulation object.

Get the type of the simulation object.

Attributes

Inherited from:
Identifiable
def thresholdD(f: VectorD, b: VectorD): Boolean

Return whether the vector inequality is true: f >= b. The firing threshold should be checked for every incoming arc. If all return true, the transition should fire.

Return whether the vector inequality is true: f >= b. The firing threshold should be checked for every incoming arc. If all return true, the transition should fire.

Value parameters

b

The base constant vector

f

The fluid vector (amount of fluid per color)

Attributes

Inherited from:
PetriNetRules
def thresholdI(t: VectorI, b: VectorI): Boolean

Return whether the vector inequality is true: t >= b. The firing threshold should be checked for every incoming arc. If all return true, the transition should fire.

Return whether the vector inequality is true: t >= b. The firing threshold should be checked for every incoming arc. If all return true, the transition should fire.

Value parameters

b

the base constant vector

t

the token vector (number of tokens per color)

Attributes

Inherited from:
PetriNetRules
override def toString: String

Convert the temporal object to a string.

Convert the temporal object to a string.

Attributes

Definition Classes
Temporal -> Any
Inherited from:
Temporal
def tokenFlow(t: VectorI, b: VectorI, r: VectorI, d: Double): VectorI

Compute the number of tokens to flow over an arc according to the vector expression: b + r * (t-b) * d. If d is 0, returns b. Supports linear (w.r.t. time delay) and constant (d == 0) flow models.

Compute the number of tokens to flow over an arc according to the vector expression: b + r * (t-b) * d. If d is 0, returns b. Supports linear (w.r.t. time delay) and constant (d == 0) flow models.

Value parameters

b

the constant vector for base token flow

d

the time delay

r

the rate vector (number of tokens per unit time)

t

the token vector (number of tokens per color)

Attributes

Inherited from:
PetriNetRules

Concrete fields

var cqueue: ConcurrentLinkedQueue[AnimateCommand]

The animation command queue

The animation command queue

Attributes

var firingDelay: Double

The firing delay for this transition

The firing delay for this transition

Attributes

Fluid vector for transition

Fluid vector for transition

Attributes

var inD: Array[ArcD]

Arcs incoming from continuous places

Arcs incoming from continuous places

Attributes

var inI: Array[ArcI]

Arcs incoming from discrete places

Arcs incoming from discrete places

Attributes

var locked: Boolean

A transition is locked from the time it is enabled until it fires

A transition is locked from the time it is enabled until it fires

Attributes

var outD: Array[ArcD]

Arcs outgoing to continuous places

Arcs outgoing to continuous places

Attributes

var outI: Array[ArcI]

Arcs outgoing to discrete places

Arcs outgoing to discrete places

Attributes

var pnet: PetriNet

The containing Petri net

The containing Petri net

Attributes

Token vector for transition

Token vector for transition

Attributes

val x: Double
val y: Double

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