edu.umass.cs.automan.core.scheduler

Scheduler

class Scheduler extends AnyRef

Controls scheduling of tasks for a given question.

Note on virtual ticks: 1. The user supplies mock answers, each with a delay_in_s parameter. 2. When the scheduler starts up, if a question comes with mock answers, the scheduler knows that it should use virtual ticks. 3. For each "tick group" (the set of answers with the same delay_in_s), the scheduler advances exactly one loop iteration. 4. When the scheduler calls backend operations, it forwards the current time, virtual or otherwise. The backend should only return answered thunks when the current time is after the time of the response.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Scheduler
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Scheduler(question: Question, backend: AutomanAdapter)

    question
    backend

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

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

    Definition Classes
    Any
  6. def accept_reject_and_cancel[A](all_tasks: List[Task], strategy: ValidationPolicy, backend: AutomanAdapter): List[Task]

    Accepts and rejects tasks on the backend.

    Accepts and rejects tasks on the backend. Returns all tasks.

    all_tasks

    All tasks.

    strategy

    The ValidationStrategy.

    backend

    A reference to the backend AutomanAdapter.

    returns

    The tasks passed in, with new states.

  7. def all_set_invariant[A](before: List[Task], after: List[Task], state: SchedulerState.Value): Boolean

    Returns true if all of the tasks from the before list are set to the given state in the after list.

    Returns true if all of the tasks from the before list are set to the given state in the after list.

    before

    A list of tasks.

    after

    A list of tasks.

    state

    The state to check.

    returns

    True if the invariant holds.

  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. val backend: AutomanAdapter

  10. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. final def eq(arg0: AnyRef): Boolean

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

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

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

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

    Definition Classes
    AnyRef → Any
  16. val init_time: Date

  17. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  18. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  21. def post_as_needed(tasks: List[Task], backend: AutomanAdapter, question: Question, suffered_timeout: Boolean, blacklist: List[String]): List[Task]

    Post new tasks if needed.

    Post new tasks if needed. Returns only newly-created tasks.

    tasks

    The complete list of tasks.

    question

    Question data.

    suffered_timeout

    True if any tasks suffered a timeout on the last iteration.

    returns

    A list of newly-created tasks.

  22. def process_timeouts(ts: List[Task], current_tick: Long): (List[Task], Boolean)

  23. val question: Question

  24. def retrieve_invariant[A](running: List[Task], answered: List[Task]): Boolean

    Given a list of RUNNING tasks and a list of tasks returned from the AutomanAdapter.

    Given a list of RUNNING tasks and a list of tasks returned from the AutomanAdapter.retrieve method, ensure that a number of invariants hold.

    running

    A list of RUNNING tasks.

    answered

    A list of tasks returned by the AutomanAdapter.retrieve method.

    returns

    True if all invariants hold.

  25. def run(): AA

    Crowdsources a task on the desired backend, scheduling and rescheduling enough jobs until the chosen quality-control mechanism is confident in the result, and paying for answers where appropriate.

  26. def spawn_invariant[A](new_tasks: List[Task]): Boolean

    The list of newly-spawned tasks should never be zero.

    The list of newly-spawned tasks should never be zero.

    new_tasks

    A list of newly-spawned tasks.

    returns

    True if the invariant holds.

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

    Definition Classes
    AnyRef
  28. def toString(): String

    Definition Classes
    AnyRef → Any
  29. def total_cost[A](tasks: List[Task]): BigDecimal

    Calculates the total cost of all tasks that might potentially be accepted.

    Calculates the total cost of all tasks that might potentially be accepted.

    tasks

    The complete list of tasks.

    returns

    The amount spent.

  30. val use_virt: Boolean

  31. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped