public interface IDowntime<T>
An interface to play the role of the Downtime block in the engine environment. User interacts with instances of this interface
when querying the list of Downtime blocks connected to the maintenanceable markups.
- Author:
- AnyLogic North America, LLC https://anylogic.com
Modifier and Type | Method | Description |
---|---|---|
boolean | customFirstOccurrence |
Enables the custom trigger values for the first downtime occurrence.
|
int | cyclesToFirstOccurrence |
Defines the number of working cycles from the start of the resource unit's life to the first occurrence of this downtime.
|
int | cyclesToOccurrence |
Defines the number of working cycles between subsequent occurrences of this downtime.
|
String | getName() | |
boolean | isActive | |
boolean | mayPreempt |
Sets whether the downtime task may preempt the task currently being executed, if any.
|
double | priority |
Sets the priority of the downtime task
|
void | restartTriggers |
Resets triggers' countdowns and starts waiting for the next triggering events.
|
Schedule<Boolean> | schedule |
Schedule of type "on/off", where each "on" period starts a downtime.
|
void | startTask |
Starts this task logic (maintenance / failure-repair / custom) right now for the given resource unit and resets all the triggers
according to their settings.
|
void | stopTask |
[Actual for "Delay until stopTask() is called" downtime task type]
Finishes this downtime task logic (maintenance / failure-repair / custom) right now for the given resource unit
and restarts all the triggers according to their settings.
|
double | taskDuration |
[Actual for "Delay" downtime task type, when downtime uses cyclic occurrence triggers, not schedule]
The duration of downtime task (maintenance, failure, etc.).
|
boolean | timeStartsAfterTaskEnd() |
[Actual for "total time" trigger]
Depending on this parameter, the total (working+idling) time between subsequent occurrences of the downtime starts countdown
either from the beginning or from the end of the corresponding "downtime task".
|
double | totalTimeToFirstOccurrence |
Defines the total (working+idling) time from the start of the resource unit's life to the first occurrence of this downtime.
|
double | totalTimeToOccurrence |
Defines the total (working+idling) time between subsequent occurrences of this downtime.
|
double | workingTimeToFirstOccurrence |
Defines the working time from the start of the resource unit's life to the first occurrence of this downtime.
|
double | workingTimeToOccurrence |
Defines the working time between subsequent occurrences of this downtime.
|
String getName()
double priority(T unit)
Sets the priority of the downtime task
boolean mayPreempt(T unit)
Sets whether the downtime task may preempt the task currently being executed, if any.
In other words, 'true' means that unit may "drop its work" right at the moment of the downtime.
If 'false', then the unit will finish all its tasks with less priority.
Note that 'true' option has exceptions: current unit task may have a "non-interruptable" option NO_PREEMPTION.
boolean customFirstOccurrence(T unit)
Enables the custom trigger values for the first downtime occurrence.
If not enabled, the first downtime will occur based on the "between occurrences" trigger value(s).
double totalTimeToFirstOccurrence(T unit, TimeUnits timeUnits)
Defines the total (working+idling) time from the start of the resource unit's life to the first occurrence of this downtime.
Leave both fields ("to first occurrence" and "to occurrence") empty to disable this type of trigger.
- Parameters:
unit
- resource unit
double totalTimeToOccurrence(T unit, TimeUnits timeUnits)
Defines the total (working+idling) time between subsequent occurrences of this downtime.
Depending on the
timeStartsAfterTaskEnd()
parameter, this timeout counts either from the beginning or
from the end of the corresponding "downtime task". In case of several triggers defined, when a different trigger starts the downtime, this
"total time" trigger will be restarted upon downtime task end.
Leave both this and "to first occurrence" fields (if custom first occurrence is enabled) empty to disable this type of trigger.- Parameters:
unit
- resource unit
boolean timeStartsAfterTaskEnd()
[Actual for "total time" trigger]
Depending on this parameter, the total (working+idling) time between subsequent occurrences of the downtime starts countdown
either from the beginning or from the end of the corresponding "downtime task". In case of several triggers defined, when a
different trigger starts the downtime, this "total time" trigger will be restarted upon downtime task end.
double workingTimeToFirstOccurrence(T unit, TimeUnits timeUnits)
Defines the working time from the start of the resource unit's life to the first occurrence of this downtime.
Resource unit counts the time while servicing other agents of any type.
Leave both fields ("to first occurrence" and "to occurrence") empty to disable this type of trigger.
- Parameters:
unit
- resource unit
double workingTimeToOccurrence(T unit, TimeUnits timeUnits)
Defines the working time between subsequent occurrences of this downtime. Resource unit counts the time while servicing other agents of any type.
Leave both this and "to first occurrence" fields (if custom first occurrence is enabled) empty to disable this type of trigger.
- Parameters:
unit
- resource unit
int cyclesToFirstOccurrence(T unit)
Defines the number of working cycles from the start of the resource unit's life to the first occurrence of this downtime.
Resource unit counts each cycle of servicing other agents of any type. Suspending servicing work because of preemption increases the number of cycles.
Leave both fields ("to first occurrence" and "to occurrence") empty to disable this type of trigger.
- Parameters:
unit
- resource unit
int cyclesToOccurrence(T unit)
Defines the number of working cycles between subsequent occurrences of this downtime. Resource unit counts each cycle of servicing
other agents of any type. Suspending servicing work because of preemption increases the number of cycles.
Leave both this and "to first occurrence" fields (if custom first occurrence is enabled) empty to disable this type of trigger.
- Parameters:
unit
- resource unit
Schedule<Boolean> schedule(T unit)
Schedule of type "on/off", where each "on" period starts a downtime. If downtime task is defined using "Delay",
the corresponding downtime task duration is taken from this schedule.
double taskDuration(T unit, TimeUnits timeUnits)
[Actual for "Delay" downtime task type, when downtime uses cyclic occurrence triggers, not schedule]
The duration of downtime task (maintenance, failure, etc.). Timeout is calculated each downtime for each resource unit.
Downtime finishes after this timeout.
- Parameters:
unit
- the resource unittimeUnits
- time units
boolean isActive(IMaintenanceable unit)
void restartTriggers(IMaintenanceable unit)
Resets triggers' countdowns and starts waiting for the next triggering events.
void startTask(IMaintenanceable unit)
Starts this task logic (maintenance / failure-repair / custom) right now for the given resource unit and resets all the triggers
according to their settings. For example, if the "working time to occurrence" trigger is defined, it will stop its countdown and
restart after the task activity finishes.
Special case: when this Downtime is not registered in the Resource Pool (or markup) properties, this function will treat the
task as triggered manually only: any time/work/etc-based triggers defined in this task, not be activated.
void stopTask(IMaintenanceable unit)
[Actual for "Delay until stopTask() is called" downtime task type]
Finishes this downtime task logic (maintenance / failure-repair / custom) right now for the given resource unit
and restarts all the triggers according to their settings.