Package-level declarations

Types

Link copied to clipboard

Serve every stop, as soon as you reach it. The default, and what every fleet did before there was a control to ask.

Link copied to clipboard

Append each new task's stops to the end, changing nothing already planned.

Link copied to clipboard

The subsystem's principal extension point: who gets sent where.

Link copied to clipboard
class BatchedAssignmentPolicy(val window: Double, val inner: AssignmentPolicyIfc = NearestVehiclePolicy()) : AssignmentPolicyIfc

Wait for a window, then assign everything that accumulated during it, together.

Link copied to clipboard
data class Bid(val vehicle: FleetVehicle, val value: Double, val note: String? = null)

A vehicle's offer.

Link copied to clipboard
fun interface BidPolicyIfc

What a vehicle offers when a dispatcher calls for proposals.

Link copied to clipboard

Longest-waiting first, regardless of priority.

Link copied to clipboard

Higher priority first, ties broken by how long the task has waited.

Link copied to clipboard
data class CallForProposals(val task: Dispatcher.Task, val issuedAt: Double)

A dispatcher's invitation to bid on a task.

Link copied to clipboard
class ChargeReservePolicy @JvmOverloads constructor(val inner: AssignmentPolicyIfc, val safetyFactor: Double = 1.25) : AssignmentPolicyIfc

Refuses any assignment a vehicle could not finish and still reach a charger.

Link copied to clipboard
class ChargeWhenLowDisposition @JvmOverloads constructor(val threshold: Double = 0.25, val otherwise: DispositionPolicyIfc = ReturnToHomeBaseDisposition()) : DispositionPolicyIfc

Send the vehicle to charge when it is low, and otherwise do whatever another policy says.

Link copied to clipboard

Put each new stop wherever it adds least travel, subject to precedence and capacity.

Link copied to clipboard

Bid the time to finish the whole job: travel to the pickup, then carry the load to its destination, at this vehicle's own velocity.

Link copied to clipboard
class ConsolidatingPolicy @JvmOverloads constructor(val inner: AssignmentPolicyIfc = NearestVehiclePolicy()) : AssignmentPolicyIfc

Fill a vehicle that has room, rather than giving it one task and moving on.

Link copied to clipboard
class ContractNetAssignmentPolicy(val deadline: Double, val selectBest: (List<Bid>) -> Bid? = ::lowestBidByName) : AssignmentPolicyIfc

Award each task by Contract-Net auction: the dispatcher calls for proposals, the vehicles bid, the best bid wins.

Link copied to clipboard
class DeclineWhenBusyBid(inner: BidPolicyIfc = NetworkDistanceBid()) : BidPolicyIfc

Bid distance, but decline outright when already carrying out a task.

Link copied to clipboard

What a policy is given, and the only things it may do.

Link copied to clipboard

Ask the dispatcher, and do what it says.

Link copied to clipboard
sealed class Disposition

What a vehicle does with itself when the dispatcher has no work for it.

Link copied to clipboard
fun interface DispositionPolicyIfc

Decides what an idle vehicle does with itself.

Link copied to clipboard

The vehicle-to-task matchings available at this instant, as something a policy can enumerate and search rather than a predicate it applies after guessing.

Link copied to clipboard

Queue order, unchanged. The default, and the one that makes the queue discipline the whole rule.

Link copied to clipboard

Send the vehicle furthest from the pickup.

Link copied to clipboard

Send whichever available vehicle has completed the fewest tasks so far.

Link copied to clipboard

Send the vehicle to a named staging point.

Link copied to clipboard

Send the vehicle nearest the pickup, measured along the guide path.

Link copied to clipboard

Bid the distance to the pickup, and decline when it is unreachable.

Link copied to clipboard

Leave the vehicle where it stopped. See the warning on ReturnToHomeBaseDisposition.

Link copied to clipboard

Collect everything first, then deliver everything.

Link copied to clipboard

The first available vehicle takes the first unassigned task.

Link copied to clipboard

Send a uniformly chosen available vehicle.

Link copied to clipboard
class ReassigningPolicy(val improvementThreshold: Double, val inner: AssignmentPolicyIfc = ScoringAssignmentPolicy { p, f -> f.cost(p.vehicle, p.task) }) : AssignmentPolicyIfc

Takes a task back from a vehicle when a materially better pairing has become available.

Link copied to clipboard

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

Link copied to clipboard

Send the vehicle home. The default, and the safe one.

Link copied to clipboard

Scores every feasible pairing and takes the best.

Link copied to clipboard
fun interface TaskSelectionRuleIfc

Determines the order in which an assignment policy is shown the outstanding tasks.

Link copied to clipboard

Hold at each stop until its scheduled departure, measured from the start of the cycle.

Link copied to clipboard

What a tour policy is given to decide with.

Link copied to clipboard
fun interface TourPolicyIfc

The order a vehicle visits the stops it has committed to.

Link copied to clipboard
open class VisitAndAssessPolicy @JvmOverloads constructor(technicians: ResourceWithQ, walkingTime: RVariableIfc, assessmentTime: RVariableIfc, refuge: String, towVelocity: Double, reportingDelay: RVariableIfc? = null) : InterruptionPolicyIfc

Somebody free walks to the stopped vehicle, looks at it, and pushes it out of the aisle if it is in anybody's way.

Properties

Link copied to clipboard

The assignment policies a name can select, in the order an interface should offer them.

Functions

Link copied to clipboard

The policy a name stands for, made fresh -- which matters for a policy that carries state between decisions, so that one never inherits the end of a run it was not part of.

Link copied to clipboard
fun lowestBidByName(bids: List<Bid>): Bid?

The default award rule: lowest bid, ties broken by vehicle name.

Link copied to clipboard

The name of a policy, or null when it is one no name stands for.