Coroutine

scalation.simulation.Coroutine
See theCoroutine companion object
abstract class Coroutine(label: String = ...) extends Runnable

The Coroutine class supports (one-at-a-time) quasi-concurrent programming. A coroutine runs/acts until it yields control from 'this' to 'that' coroutine. When resumed, a coroutines continues its execution where it left off.

Value parameters

label

the label for the class of coroutines to be created.

Attributes

Companion
object
Graph
Supertypes
trait Runnable
class Object
trait Matchable
class Any
Known subtypes
class Model
class BankModel
class LoopModel
class MachineModel
class RoadModel
class TrafficModel
class UGA_BusModel
class BankModel
class Model_MBM
class BankModel
class SOMEModel
class SimActor
class BankModel.this.Customer
class CallCenterModel.this.Call
class EmerDeptModel.this.Patient
class LoopModel.this.Car1
class LoopModel.this.Car2
class MachineModel.this.Part
class OneWayStreetModel.this.Car
class RoadModel.this.Car1
class RoadModel.this.Car2
class TrafficModel.this.Car
class TrafficModelTurn.this.Car
class UGA_BusModel.this.Rider
class BankModel.this.Customer
class BankModel.this.Customer
class Bus
class UGA_BusModel.this.UGA_Bus
class Gate
class SOMEModel.this.SOMEActor
class Source
class VSource
class Vehicle
class OneWayVehicleModel.this.Car
class TrafficDynModel.this.Car
class Cor1
class Cor2
Show all

Members list

Value members

Abstract methods

def act(): Unit

Actor model features the 'act' method, even though threads are used. This abstract method must be implemented in application models.

Actor model features the 'act' method, even though threads are used. This abstract method must be implemented in application models.

Attributes

Concrete methods

def counts: (Int, Int, Int)

Return the Coroutine counts.

Return the Coroutine counts.

Attributes

def interrupt(): Unit

Interrupt this waiting coroutine.

Interrupt this waiting coroutine.

Attributes

def isVirtual: Boolean

Check this thread to see if it is virtual.

Check this thread to see if it is virtual.

Attributes

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

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

def start(): Unit

Start this coroutine, i.e., invoke its 'run' -> 'act' method.

Start this coroutine, i.e., invoke its 'run' -> 'act' method.

Attributes

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