ReconsiderOnInterruption

Asks the dispatcher to look at the board again whenever a vehicle stops or comes back.

Not automatic, and worth understanding why. The dispatcher is woken by the two things that change a decision from inside the subsystem -- a task being posted and a vehicle declaring itself available -- and a breakdown is neither. A vehicle that stops mid-approach keeps its assignment, declares nothing, and posts nothing, so nothing wakes the dispatcher and the task it was carrying out sits with a vehicle that will not reach it for as long as the repair lasts.

For most fleets that costs nothing: the default dispatching rule would not take the task back anyway, because it has no rule for doing so. It matters for a fleet running a re-tasking policy, which could hand the work to a vehicle that is still moving -- and which cannot, because it is never asked. Attaching this is how a model says it wants to be asked.

It is opt-in rather than built in because waking the dispatcher is an event, and adding one to every breakdown would change the event sequence of every existing model that has failures -- including the order of things that happen at the same instant -- for a benefit only some of them can use.

agv.attachInterruptionListener(ReconsiderOnInterruption(agv.dispatcher))

Constructors

Link copied to clipboard
constructor(dispatcher: Dispatcher)

Functions

Link copied to clipboard
open override fun outOfService(interruption: Interruption)

The policy returned and the vehicle is still not fit to carry on, so it is out for the rest of the replication -- standing where it stopped and holding its zones.

Link copied to clipboard
open override fun returnedToService(interruption: Interruption, outOfServiceFor: Double)

The policy put the vehicle right and it is going back to work.

Link copied to clipboard
open override fun stopped(interruption: Interruption)

The vehicle has stopped and its policy is about to run.

Link copied to clipboard
open override fun toString(): String