cancel

Abandons a task a vehicle raised for itself.

A TransportTask cannot be cancelled, and the refusal is deliberate rather than an omission. A load that asked for transport is suspended waiting for it, and there is no safe thing to do with that load: leaving it suspended strands it for the rest of the replication; terminating its process kills work that may have had nothing to do with the transport; and resuming it with an outcome only helps if the modeller handles that outcome, which Kotlin cannot oblige them to do -- a discarded return value is not a compile error, and the resulting model carries on as though the load had been delivered.

MovableResource declines to offer cancellation for the same reason, so a modeller learns one rule rather than two. If a load must give up entirely, TaskQ.removeAndTerminate ends its process outright -- blunt, but honest about being blunt, and it leaves nothing suspended.

A ServiceTask is different in the way that matters: a vehicle raised it for itself, so nothing is waiting on it and cancelling one strands nobody. "You were going to park, but work has arrived" is a real thing to want, and it is safe.

A vehicle already committed to the task is released first, so it does not go on to a task that no longer exists.

Throws

when the task is a transport request.