Class/Object

com.generativists.thirdway.core

Schedule

Related Docs: object Schedule | package core

Permalink

class Schedule[Env] extends Clearable with Serializable

Linear Supertypes
Serializable, Serializable, Clearable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Schedule
  2. Serializable
  3. Serializable
  4. Clearable
  5. AnyRef
  6. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Schedule(time: Double, step: Long, rng: RNG)

    Permalink

Value Members

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clear(): Unit

    Permalink

    Empty the queue but maintain all other state variables.

    Empty the queue but maintain all other state variables.

    Definition Classes
    Schedule → Clearable
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. def dequeueAll(): IndexedSeq[Event[Env]]

    Permalink

    Empty the queue and return all Events in prioritized order.

  8. def enqueue(at: Double, group: Int = Schedule.DefaultGroup, activity: Activity[Env]): Unit

    Permalink

    Add an event to the Schedule.

    Add an event to the Schedule.

    To maintain a hygienic schedule, the at time must meet several preconditions.

    - It must be less than the MaximumTime. - It must not be NaN. - It cannot precede or equal the Epoch - It cannot precede the current schedule time.

    Violation of any of these conditions ​results in a raised ArgumentError.

    Additionally, at is always greater than the Schedule time. However, this method does not thrown an exception if at == this.time. Instead, at is incremented by the smallest amount possible. Effectively, scheduling at the current time asks the scheduler to run something at the next tick.

    at

    the schedule time at which the event should activate

    group

    the activation group, given the same time

    activity

    the activity to run

    Attributes
    protected
  9. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  13. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  14. def isEmpty: Boolean

    Permalink

    returns

    true if any Events are enqueued

  15. def isExhausted: Boolean

    Permalink

    returns

    true if the schedule was ever run and it is now empty

  16. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  17. def length: Int

    Permalink

    returns

    the number of enqueued Events

  18. def merge(other: Schedule[Env]): Unit

    Permalink

    Merge two schedules.

    Merge two schedules.

    This method schedules the activities of other on the called schedule. However, it **does not** remove them from other. Call that.clear() afterwards if that is the desired behavior.

    Raises an ArgumentError if the the other schedule has events in this schedules past.

  19. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  20. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  21. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  22. def once[R](time: Double, group: Int)(f: (Env, Schedule[Env]) ⇒ R): Unit

    Permalink

    Schedule an function (as an activity) to run once at a given time and group.

  23. def once(activity: Activity[Env], time: Double, group: Int = Schedule.DefaultGroup): Unit

    Permalink

    Schedule an activity to run once at a given time and group.

  24. def onceIn[R](delta: Double, group: Int)(f: (Env, Schedule[Env]) ⇒ R): Unit

    Permalink

    Schedule an activity (as an activity) to run once at time+delta and group.

  25. def onceIn(activity: Activity[Env], delta: Double, group: Int = Schedule.DefaultGroup): Unit

    Permalink

    Schedule an activity to run once at time+delta and group.

  26. def peek: Event[Env]

    Permalink
  27. val queue: PriorityQueue[Event[Env]]

    Permalink

    The queue is the core of scheduling.

    The queue is the core of scheduling. It prioritizes Events in reverse order, so that the item with the lowest time then the lowest ordering goes first.

    Attributes
    protected
  28. def repeating[R](startAt: Double, interval: Double, group: Int)(f: (Env, Schedule[Env]) ⇒ R): Stoppable[Env]

    Permalink

    Schedule a function (as an action) repeatedly at a fixed interval.

  29. def repeating(activity: Activity[Env], startAt: Double = 1.0, interval: Double = 1.0, group: Int = Schedule.DefaultGroup): Stoppable[Env]

    Permalink

    Schedule an action run repeatedly at a fixed interval.

    Schedule an action run repeatedly at a fixed interval.

    activity

    the activity to run repeatedly

    startAt

    the initial scheduled time

    interval

    the interval (in time) for rescheduling

    group

    the group relative to other Events at the same time

    returns

    a Stoppable for possible early termination

  30. def reset(): Unit

    Permalink

    Resets all items back to their pristine state, except for the RNG

  31. val rng: RNG

    Permalink
  32. def run(env: Env)(continueCondition: (Schedule[Env]) ⇒ Boolean): Unit

    Permalink

    Runs a schedule until over an environment until it is exhausted or the continueConditional returns false.

  33. def runNSteps(env: Env, n: Int): Unit

    Permalink

    Runs a schedule over an environment for n steps or until it is exhausted.

  34. def runOneStep(env: Env): Boolean

    Permalink

    Runs the schedule one step forward over some environment.

    Runs the schedule one step forward over some environment.

    Time and step are set **prior** to each activity's execution.

    A step corresponds to a time with scheduled activities. For example, given two activities at 1.0, one at 3.0, and one at 9.0, the corresponding step (after each time runs) is 1, 2, and 3, respectively.

    Activities scheduled at the same time but with a different group run over the same step. However, activities with a lower group (i.e. higher priority) are guaranteed to run first. Activities at the same time and the same group run in a random order.

    env

    the environment given to each activity

    returns

    true if the any activity was executed, false otherwise

  35. def runUntilExhausted(env: Env): Unit

    Permalink

    Runs a schedule until it is exhausted

  36. val shufflerTmp: ArrayBuffer[Event[Env]]

    Permalink

    The runOneStep method collects Events that should run next into a collection.

    The runOneStep method collects Events that should run next into a collection. Rather than reallocating that collection each time, Schedule allocates it once in shuffleTmp. Then, the Schedule clears it as needed.

    Attributes
    protected
  37. var step: Long

    Permalink
  38. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  39. var time: Double

    Permalink
  40. def toString(): String

    Permalink
    Definition Classes
    Schedule → AnyRef → Any
  41. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Clearable

Inherited from AnyRef

Inherited from Any

Ungrouped