ScenarioExecutionStatus
Contains information about the current state of execution
Example
// Retrieving an ExecutionStatus from a scenario.
var statusPromise = scenario.getCurrentExecutionStatus();
statusPromise
.then( function (status) {
// status available here
});
Method summary
| name | description |
|---|---|
| getExecutionTime | The amount of time this job has been executing. |
| getGap | Returns the current relative gap for this job. |
| getJobId | The identifier of the job associated with this execution status. |
| getNumberOfSolutions | Returns the current number of solutions for this job. |
| getObjective | Returns the current objective value for this job. |
| getScenarioId | The identifier of the scenario associated with this execution status. |
| getStatus | Return the job state code. |
| isExecuting | Returns true if this job is executing. |
| isQueued | Returns true if this job is queued for execution. |
constructor
Constructor
Snapshot of the current scenario's execution status.
Parameters:
params
| Name | Type | Description |
|---|---|---|
| scenarioId | the scenario associated with this execution status | |
| data | execution status data |
details
Methods
- getExecutionTime ( ) → {number}
-
The amount of time this job has been executing.
detailsReturns:returns tableType Description typenumberthe amount of time this job has been executing Example
examples
Back to Topvar execTimeInMs = status.getExecutionTime(); - getGap ( ) → {number}
-
Returns the current relative gap for this job.
detailsReturns:returns tableType Description typenumberthe current relative gap for this job Example
examples
Back to Topvar gapNum = status.getGap(); - getJobId ( ) → {string}
-
The identifier of the job associated with this execution status.
detailsReturns:returns tableType Description typestringthe job identifier associated with this execution status Example
examples
Back to Topvar jobId = status.getJobId(); - getNumberOfSolutions ( ) → {number}
-
Returns the current number of solutions for this job.
detailsReturns:returns tableType Description typenumberthe current number of solutions for this job Example
examples
Back to Topvar numSolutions = status.getNumberOfSolutions(); - getObjective ( ) → {number}
-
Returns the current objective value for this job.
detailsReturns:returns tableType Description typenumberthe current objective value for this job Example
examples
Back to Topvar num = status.getObjective(); - getScenarioId ( ) → {string}
-
The identifier of the scenario associated with this execution status.
detailsReturns:returns tableType Description typestringthe scenario identifier associated with this execution status Example
examples
Back to Topvar scenId = status.getScenarioId(); - getStatus ( ) → {insight.enums.ScenarioExecutionStatus}
-
Return the job state code.
detailsReturns:returns tableType Description typeinsight.enums.ScenarioExecutionStatusthe job state code Example
examples
Back to Topif ( status.getStatus() === insight.enums.ScenarioExecutionStatus.EXECUTING ) { // do something if scenario is executing } - isExecuting ( ) → {boolean}
-
Returns true if this job is executing.
detailsReturns:returns tableType Description typebooleantrue if this job is executing, otherwise false Example
examples
Back to Topif ( status.isExecuting() ) { // run if scenario is currently executing. } - isQueued ( ) → {boolean}
-
Returns true if this job is queued for execution.
detailsReturns:returns tableType Description typebooleantrue if this job is queued for execution, otherwise false Example
examples
Back to Topif ( status.isqQueued() ) { // run if scenario is currently queued for execution. }
method
method
method
method
method
method
method
method
method
