scalation.process

Model

Related Doc: package process

class Model extends Coroutine with Modelable with Component

The Model class maintains a list of components making up the model and controls the flow of entities (SimActors) through the model, following the process-interaction world-view. It maintains a time-ordered priority queue to activate/re-activate each of the entities. Each entity (SimActor) is implemeneted as a Scala Actor and may be thought of as running in its own thread.

Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Model
  2. Component
  3. Locatable
  4. Identifiable
  5. Error
  6. Modelable
  7. Coroutine
  8. Runnable
  9. AnyRef
  10. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Model(name: String, reps: Int = 1, animating: Boolean = true, aniRatio: Double = 1.0, full: Boolean = true)

    name

    the name of the model

    reps

    the number of independent replications to run

    animating

    whether to animate the model

    aniRatio

    the ratio of simulation speed vs. animation speed

    full

    generate a full report with both sample and time-persistent statistics

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  4. val DIAM: Double

    Diameter of a token (for animating entities)

    Diameter of a token (for animating entities)

    Definition Classes
    Component
  5. val HOUR: Double

    The number of seconds in one hour

    The number of seconds in one hour

    Attributes
    protected
    Definition Classes
    Modelable
  6. val MINUTE: Double

    The number of seconds in one minute

    The number of seconds in one minute

    Attributes
    protected
    Definition Classes
    Modelable
  7. val RAD: Double

    Radius of a token (for animating entities)

    Radius of a token (for animating entities)

    Definition Classes
    Component
  8. var _clock: Double

    The clock that keep track of the current simulation time

    The clock that keep track of the current simulation time

    Attributes
    protected
    Definition Classes
    Modelable
  9. 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
  10. def act(): Unit

    The model itself is an Actor (not an ordinary SimActor) and may be thought of as the director.

    The model itself is an Actor (not an ordinary SimActor) and may be thought of as the director. The director iteratively manages the clock and the agenda of actors until the simulation flag becomes false or the agenda (priority queue) becomes empty.

    Definition Classes
    ModelCoroutine
  11. def addComponent(_parts: Component*): Unit

    Add component parts to the model.

    Add component parts to the model.

    _parts

    the component parts

  12. def addComponents(_parts: List[Component]*): Unit

    Add lists of component parts to the model.

    Add lists of component parts to the model.

    _parts

    the lists of component parts

  13. def aggregate(): Unit

    Aggregate the statistics of this component's subparts.

    Aggregate the statistics of this component's subparts.

    Definition Classes
    Component
  14. def animate(who: Identifiable, what: animation.CommandType.Value, color: Color, shape: Shape, from: Component, to: Component, at: Array[Double] = Array ()): Unit

    Put a edge command on the animation queue.

    Put a edge command on the animation queue.

    who

    who is being animated

    what

    what animation command

    color

    the color the edge

    shape

    the shape of the edge

    from

    the location of the origination node

    to

    the location of the destination node

    at

    the location of the edge (empty array => implicitly determined)

  15. def animate(who: Identifiable, what: animation.CommandType.Value, color: Color, shape: Shape, at: Array[Double]): Unit

    Put a node/token command on the animation queue.

    Put a node/token command on the animation queue.

    who

    who is being animated

    what

    what animation command

    color

    the color the node/token

    shape

    the shape of the node/token

    at

    the location of the node/token

  16. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  17. def at: Array[Double]

    Return where this object is at (its location).

    Return where this object is at (its location).

    Definition Classes
    Locatable
  18. def cleanup(): Unit

    Cleanup the agenda and any stateful components.

    Cleanup the agenda and any stateful components. Any actors left in the agenda or a wait queue must be terminated. The model (i.e., the director) must be terminated as well.

  19. def clock: Double

    Return the current value of the director's clock.

    Return the current value of the director's clock.

    Definition Classes
    Modelable
  20. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. def complete(): Unit

    Wait for the main simulation Coroutine to complete.

  22. 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
  23. def counts: (Int, Int, Int)

    Return the Coroutine counts.

    Return the Coroutine counts.

    Definition Classes
    Coroutine
  24. def director: Model

    Return the director who controls the play/simulation this component is in.

    Return the director who controls the play/simulation this component is in.

    Definition Classes
    Component
  25. def display(): Unit

    Put the components on the animation engine's queue.

    Put the components on the animation engine's queue.

    Definition Classes
    ModelComponent
  26. 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
  27. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  28. def equals(that: Any): Boolean

    Determine whether Identifiable object 'this' equals Identifiable object 'that'.

    Determine whether Identifiable object 'this' equals Identifiable object 'that'. Works since 'id' is unique for all Identifiable objects.

    Definition Classes
    Identifiable → AnyRef → Any
  29. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  30. def flaw(method: String, message: String): Unit

    Show the flaw by printing the error message.

    Show the flaw by printing the error message.

    method

    the method where the error occurred

    message

    the error message

    Definition Classes
    Error
  31. val full: Boolean

    generate a full report with both sample and time-persistent statistics

  32. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  33. def getStatistics: ListBuffer[Statistic]

    Return the statistical results of the simulation (statistics for each part).

    Return the statistical results of the simulation (statistics for each part). This includes the sample/duration statistics and if 'full', time persistent statistics as well.

  34. def hashCode(): Int

    Return the hashCode as the unique id.

    Return the hashCode as the unique id.

    Definition Classes
    Identifiable → AnyRef → Any
  35. def id: Int

    Get the id (unique identifier).

    Get the id (unique identifier).

    Definition Classes
    Identifiable
  36. def initComponent(label: String, loc: Array[Double]): Unit

    Initialize this component (all of its vars).

    Initialize this component (all of its vars).

    label

    the name of this component

    loc

    the location of this component

    Definition Classes
    Component
  37. def initStats(label: String): Unit

    Initialize this component's statistical collectors.

    Initialize this component's statistical collectors. Sample statistics: all Components. Time-persistent statistics: all except Gate, Source and Sink.

    label

    the name of this component

    Definition Classes
    Component
  38. def interrupt(): Unit

    Interrupt this waiting zombie coroutine.

    Interrupt this waiting zombie coroutine.

    Definition Classes
    Coroutine
  39. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  40. def isZombie: Boolean

    Return whether this coroutine is a zombie.

    Return whether this coroutine is a zombie.

    Definition Classes
    Coroutine
  41. def me: String

    Return the full identity.

    Return the full identity.

    Definition Classes
    Identifiable
  42. def name: String

    Get the name.

    Get the name.

    Definition Classes
    Identifiable
  43. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  44. final def notify(): Unit

    Definition Classes
    AnyRef
  45. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  46. 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
  47. val reps: Int

    the number of independent replications to run

  48. def reschedule(actor: SimActor): Unit

    Schedule (first time) or reschedule (subsequent times) an actor to act.

    Schedule (first time) or reschedule (subsequent times) an actor to act.

    actor

    the actor to be scheduled

  49. def reset(): Unit

    Reset the agenda and stateful components for next replication.

  50. def resetStats(rep: Int): Unit

    Reset and aggregate all statistics.

    Reset and aggregate all statistics.

    rep

    the current replication (1, ... reps)

  51. 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
  52. def setAt(loc: Array[Double]): Unit

    Set the location of this object.

    Set the location of this object.

    loc

    the location of this object

    Definition Classes
    Locatable
  53. def setDirector(dir: Model): Unit

    Set this component's director (the controller of the simulation model).

    Set this component's director (the controller of the simulation model).

    dir

    the director of the play/simulation

    Definition Classes
    Component
  54. def setName(label: String): Unit

    Set the name.

    Set the name.

    label

    the name to assign

    Definition Classes
    Identifiable
  55. def simType: String

    Get the type of the simulation object.

    Get the type of the simulation object.

    Definition Classes
    Identifiable
  56. def simulate(_startTime: Double = 0.0): Unit

    Execute the simulation (includes scheduling all Sources) returning summary statistics.

    Execute the simulation (includes scheduling all Sources) returning summary statistics.

    Definition Classes
    ModelModelable
  57. var simulating: Boolean

    Simulation execution/termination flag

    Simulation execution/termination flag

    Attributes
    protected
    Definition Classes
    Modelable
  58. def start(): Unit

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

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

    Definition Classes
    Coroutine
  59. val subpart: ListBuffer[Component]

    List of subparts of the Component (empty for atomics, nonempty for composites)

    List of subparts of the Component (empty for atomics, nonempty for composites)

    Definition Classes
    Component
  60. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  61. 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
  62. def theActor: SimActor

    Return the current acting actor.

  63. def toString(): String

    Definition Classes
    AnyRef → Any
  64. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  65. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  66. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  67. 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
  68. def zombify(): Unit

    Zombify this coroutine.

    Zombify this coroutine.

    Definition Classes
    Coroutine

Inherited from Component

Inherited from Locatable

Inherited from Identifiable

Inherited from Error

Inherited from Modelable

Inherited from Coroutine

Inherited from Runnable

Inherited from AnyRef

Inherited from Any

Ungrouped