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 SimAgent
class Customer
class Reporter
class Call
class Car
class Car
class Bus
class Gate
class Source
class Model
class BankModel
class LoopModel
class MachineModel
class RoadModel
class TrafficModel
class UGA_BusModel
class BankModel
class Model_MBM
class BankModel
class SimActor
class Customer
class Call
class Patient
class Car1
class Car2
class Part
class Car
class Car1
class Car2
class Car
class Car
class Car
class Car
class Rider
class Customer
class Customer
class Bus
class UGA_Bus
class Gate
class Source
class VSource
class Vehicle
class 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