mamut_routing_lib.solvers.kayros¶
KAYROS as a registry solver (kayros): time-dependent TDVRP / TDVRPTW with Duration or FleetCostDuration.
KAYROS is a separate package (pip install kayros, or the tools'
[kayros] extra) that implements the lib's TD checker contract. Its search is
one native call whose only way back into Python is the on_incumbent hook: a
stop request raised from the hook is not seen once the search stops improving,
which can be the rest of the time limit.
The adapter therefore runs each solve in a child Python process
(solvers._kayros_worker) through the external-solver process runner: its own
process group, a hard timeout, and a stop request (the monitor, Ctrl-C, a GUI
cancel) that kills the process within a poll. The worker saves every incumbent
before reporting it, so a stopped solve still returns its last incumbent's
routes. So does a solve whose worker dies without a result -- the system kills
a process that runs out of memory, and native code can crash: the run then
ends as feasible with stopped_early, its error says how the worker
ended, and the provenance has recovered_from_checkpoint. An error that the
worker reports itself stays a failed result. The routes are re-checked by the
lib's TD checker afterwards (solvers.run.run_solver), like every other
solver's.
PROGRESS_PATTERN
module-attribute
¶
KayrosSolver
¶
KAYROS for the Duration and FleetCostDuration objectives on time-dependent instances.
availability
¶
Source code in MAMUT-routing-lib/src/mamut_routing_lib/solvers/kayros.py
supports
¶
Source code in MAMUT-routing-lib/src/mamut_routing_lib/solvers/kayros.py
solve
¶
Source code in MAMUT-routing-lib/src/mamut_routing_lib/solvers/kayros.py
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 | |