Task

case
class Task(name: String, id: Option[UUID], duration: LongDistribution, cost: Distribution, minStartTime: Long, resources: Seq[String], interrupt: Int, priority: Int, createTime: Long)

A generator/factory of tasks (specifically TaskInstances).

As a case class, it can be easily manipulated dynamically to alter its values.

Uses Distributions for the duration and cost. These may be based on random variables. The actual values are sampled at task creation time.

Although typically only 1 task is generated, in principle it can generate multiple task instances with the same properties. However, each task generated will have different samples of the Distributions.

Value Params
cost

The generator of the cost.

createTime

A custom creation time. Negative values correspond to the current time.

duration

The generator of the duration.

id

An optional unique id of the task. Otherwise a random ID will be used.

interrupt

The TaskInstance.interrupt property of the task.

minStartTime

The earliest possible starting time of the task.

name

The name of the task.

priority

The explicit priority of the task.

resources

The resources of this task

Companion
object
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Value members

Concrete methods

def create(simulation: String, currentTime: Long): TaskInstance

Generate a TaskInstance.

Generate a TaskInstance.

Value Params
addedCost

Any added cost, such as resource running costs.

currentTime

The current time.

simulation

The name of the simulation that is spawning the instance.

Returns

The generated TaskInstance.

Update the cost distribution to use.

Update the cost distribution to use.

Value Params
cost

The new cost distribution.

Returns

An updated Task.

def withCost(cost: Double): Task

Update the cost Distribution to a constant value.

Update the cost Distribution to a constant value.

Value Params
cost

The constant cost value.

Returns

An updated Task.

def withCreationTime(t: Long): Task

Update the custom creation time to use.

Update the custom creation time to use.

Value Params
t

The new creation time.

Returns

An updated Task.

Update the duration distribution to use.

Update the duration distribution to use.

Value Params
dur

The new duration distribution.

Returns

An updated Task.

def withDuration(dur: Long): Task

Update the duration distribution to a constant value.

Update the duration distribution to a constant value.

Value Params
dur

The constant duration value.

Returns

An updated Task.

def withID(i: UUID): Task

Update the ID to use.

Update the ID to use.

Value Params
i

The new ID.

Returns

An updated Task.

def withInterrupt(int: Int): Task

Update the interrupt to use.

Update the interrupt to use.

Value Params
int

The new interrupt.

Returns

An updated Task.

def withMinStartTime(t: Long): Task

Update the custom minimum starting time to use.

Update the custom minimum starting time to use.

Value Params
t

The new minimum starting time.

Returns

An updated Task.

def withName(n: String): Task

Update the task name to use.

Update the task name to use.

Value Params
n

The new name.

Returns

An updated Task.

def withPriority(p: Int): Task

Update the priority to use.

Update the priority to use.

Value Params
p

The new priority.

Returns

An updated Task.

def withResources(r: Seq[String]): Task

Update the resources to use.

Update the resources to use.

Value Params
r

The new resources.

Returns

An updated Task.

Inherited methods

def productElementNames: Iterator[String]
Inherited from
Product
def productIterator: Iterator[Any]
Inherited from
Product