AnyLogic
Expand
Font size

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

Method Summary

Modifier and TypeMethodDescription
booleancustomFirstOccurrence(T unit)
Enables the custom trigger values for the first downtime occurrence.
intcyclesToFirstOccurrence(T unit)
Defines the number of working cycles from the start of the resource unit's life to the first occurrence of this downtime.
intcyclesToOccurrence(T unit)
Defines the number of working cycles between subsequent occurrences of this downtime.
StringgetName() 
booleanisActive(IMaintenanceable unit) 
booleanmayPreempt(T unit)
Sets whether the downtime task may preempt the task currently being executed, if any.
doublepriority(T unit)
Sets the priority of the downtime task
voidrestartTriggers(IMaintenanceable unit)
Resets triggers' countdowns and starts waiting for the next triggering events.
Schedule<Boolean>schedule(T unit)
Schedule of type "on/off", where each "on" period starts a downtime.
voidstartTask(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.
voidstopTask(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.
doubletaskDuration(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.).
booleantimeStartsAfterTaskEnd()
[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".
doubletotalTimeToFirstOccurrence(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.
doubletotalTimeToOccurrence(T unit, TimeUnits timeUnits)
Defines the total (working+idling) time between subsequent occurrences of this downtime.
doubleworkingTimeToFirstOccurrence(T unit, TimeUnits timeUnits)
Defines the working time from the start of the resource unit's life to the first occurrence of this downtime.
doubleworkingTimeToOccurrence(T unit, TimeUnits timeUnits)
Defines the working time between subsequent occurrences of this downtime.

Method Details

getName

String getName()

priority

double priority(T unit)
Sets the priority of the downtime task

mayPreempt

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.

customFirstOccurrence

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).

totalTimeToFirstOccurrence

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

totalTimeToOccurrence

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

timeStartsAfterTaskEnd

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.

workingTimeToFirstOccurrence

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

workingTimeToOccurrence

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

cyclesToFirstOccurrence

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

cyclesToOccurrence

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

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.

taskDuration

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 unit
timeUnits - time units

isActive

boolean isActive(IMaintenanceable unit)

restartTriggers

void restartTriggers(IMaintenanceable unit)
Resets triggers' countdowns and starts waiting for the next triggering events.

startTask

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.

stopTask

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.