SingleTaskSimulation

class SingleTaskSimulation(val name: String, val manager: Manager, resources: Seq[String], duration: LongDistribution, cost: Distribution, interrupt: Int, priority: Int) extends Simulation

A Simulation that simulates a single Task.

Value Params
cost

A Distribution for the cost of the Task.

duration

A Distribution for the duration of the Task.

interrupt

The Task.interrupt parameter.

manager

The Manager of the simulation.

name

The simulation name.

priority

The explicit priority of the Task.

resources

The names of the TaskResources the Task will require.

class Object
trait Matchable
class Any

Document{}

def abort(ids: UUID*): Unit

Declare IDs of TaskInstances that need to be aborted.

Declare IDs of TaskInstances that need to be aborted.

Value Params
ids

The UUIDs of the TaskInstances.

Inherited from
Simulation
def ack(taskIDs: Seq[UUID]): Unit

Declares that the simulation has finished processing one or more completed TaskInstances.

Declares that the simulation has finished processing one or more completed TaskInstances.

Identifies the tasks via their UUID.

Inherited from
Simulation
def done(result: Try[Any]): Unit

Declares that the simulation completed.

Declares that the simulation completed.

Value Params
result

The result of the simulation.

Inherited from
Simulation
def fail(exception: Throwable): Unit

Declares that the simulation has failed or has been aborted.

Declares that the simulation has failed or has been aborted.

Value Params
exception

The Throwable that caused the failure.

Inherited from
Simulation

Calculates an optional Lookahead structure for tasks that are expected in the future.

Calculates an optional Lookahead structure for tasks that are expected in the future.

This is called via ready.

Returns

The current Lookahead structure.

Inherited from
Simulation
def ready(): Unit

Declares that the simulation has finished calculating and is ready for virtual time to proceed.

Declares that the simulation has finished calculating and is ready for virtual time to proceed.

Inherited from
Simulation
def simWait(): Unit

Requests that the Manager waits for this simulation before it continues.

Requests that the Manager waits for this simulation before it continues.

The simulation needs to either register more tasks and become ready or finish.

Note

We assume the Manager is already waiting for another simulation when the request is made. Otherwise virtual time may progress unexpectedly and cause unpredictable behaviour depending on the timing of the Manager messages.

Inherited from
Simulation
def succeed(result: Any): Unit

Declares that the simulation completed successfully.

Declares that the simulation completed successfully.

Value Params
result

The successful result of the simulation.

Inherited from
Simulation
def task(t: Task): Unit

Declare a new Task that needs to be sent for simulation.

Declare a new Task that needs to be sent for simulation.

Value Params
t

The Task to send.

Inherited from
Simulation

Value members

Concrete methods

override
def complete(task: TaskInstance, time: Long): Unit

Manages a completed TaskInstance.

Manages a completed TaskInstance.

The simulation logic must react to this by either registering more tasks or finishing.

If new tasks are produced, the completed TaskInstance must be acknowledged via ack. Alternatively, if we do not want to ack all completed tasks, we can just call ready. Finally, if the simulation completes, we can use done, succeed or fail accordingly.

Completes immediately with succeed.

Definition Classes
override
def run(): Unit

Starts the simulation.

Starts the simulation.

Creates and adds the corresponding Task, then calls ready immediately.

Definition Classes
override
def stop(): Unit
Definition Classes

Inherited methods

override
def completed(time: Long, tasks: Seq[TaskInstance]): Unit
Definition Classes
Inherited from
Simulation

Concrete fields

override
val name: String
lazy