Task
Default task class describes general task robot behaviour during task execution
Static Member Summary
Static Public Members | ||
public static get |
Task is executing |
|
public static get |
Task is finished and it is not be consider in the future |
|
public static get |
Task is ready to be executed |
|
public static get |
Task is suspended and waiting a chance to become ready |
Constructor Summary
Public Constructor | ||
public |
constructor(scheduler: *, parameters: Object) Default constructor for task |
Method Summary
Public Methods | ||
public |
finish() Finish this task and run next one |
|
public |
Get current state |
|
public |
Get predicted time of current task |
|
public |
Get weight of current task |
|
public |
Condition which will be checked by SchedulerService to decide to run task or not. |
|
public |
onRun() This method will be executed as soon as mep run this task |
|
public |
Change priority during runtime |
|
public |
run() Run current task and change a state |
|
public |
Set current state |
|
public |
setWeight(weight: *) Change default weight of the task |
|
public |
suspend() Suspend this task and run next one |
Static Public Members
Public Constructors
public constructor(scheduler: *, parameters: Object) source
Default constructor for task
Params:
Name | Type | Attribute | Description |
scheduler | * | {Scheduler} Reference to strategy's scheduler |
|
parameters | Object | Additional params |
|
parameters.weight | Number | Importance of the task, initial order |
|
parameters.time | Number | Predicted time to be executed |
|
parameters.location | misc.Point | Predicted area of execution |
Public Methods
public isAvailable(): Boolean source
Condition which will be checked by SchedulerService to decide to run task or not. Eg. Release lunar modules only if there is lunar modules inside robot
public setState(state: Number) source
Set current state
Params:
Name | Type | Attribute | Description |
state | Number | Can be Task.READY, Task.SUSPENDED, Task.ACTIVE and Task.FINISHED |
public setWeight(weight: *) source
Change default weight of the task
Params:
Name | Type | Attribute | Description |
weight | * | {Number} |