reinterpretcat / vrp

A Vehicle Routing Problem solver
https://reinterpretcat.github.io/vrp/
Apache License 2.0
368 stars 71 forks source link

cannot find objective idx where solution values are different #128

Closed ilibar-zpt closed 1 year ago

ilibar-zpt commented 1 year ago

Version: 1.22.1

problem.json

{"objectives": [[{"type": "minimize-unassigned","breaks": 9999}],[{"type": "minimize-cost"}]],"plan": {"jobs": [{"id": "1","pickups": [{"places": [{"location": {"lat": 52.5622847,"lng": 13.4023099},"duration": 240.0,"tag": "p1","times": [["2019-07-04T10:00:00Z","2019-07-04T13:00:00Z"]]}],"demand": [1]}],"deliveries": [{"places": [{"location": {"lat": 52.5252832,"lng": 14.4188422},"duration": 240.0,"tag": "d1","times": [["2019-07-04T11:00:00Z","2019-07-04T14:00:00Z"]]}],"demand": [1]}]}]},"fleet": {"vehicles": [{"typeId": "my_car","vehicleIds": ["my_car_1"],"profile": {"matrix": "my_car"},"costs": {"fixed": 0,"distance": 0,"time": 1},"shifts": [{"start": {"earliest": "2019-07-04T09:00:00Z","location": {"lat": 52.5316,"lng": 13.3884}},"end": {"latest": "2019-07-04T18:00:00Z","location": {"lat": 52.5316,"lng": 13.3884}},"breaks": [{"time": ["2019-07-04T11:00:00Z","2019-07-04T12:00:00Z"],"places": [{"duration": 1800.0}],"policy": "skip-if-arrival-before-end"}]}],"capacity": [5]}],"profiles": [{"name": "my_car"}]}}

Command: vrp-cli solve pragmatic problem.json --log --parallelism=1,1 --max-time=15 --min-cv=sample,10000,0.05,true

Exit code: 101 STDERR:

thread '<unnamed>' panicked at 'cannot find objective idx where solution values are different', /vrp/rosomaxa/src/hyper/dynamic_selective.rs:418:10
stack backtrace:
   0: rust_begin_unwind
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:578:5
   1: core::panicking::panic_fmt
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/panicking.rs:67:14
   2: core::panicking::panic_display
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/panicking.rs:150:5
   3: core::panicking::panic_str
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/panicking.rs:134:5
   4: core::option::expect_failed
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/option.rs:2025:5
   5: rosomaxa::hyper::dynamic_selective::get_relative_distance
   6: rosomaxa::hyper::dynamic_selective::SearchAgent<C,O,S>::search
   7: <rayon_core::job::StackJob<L,F,R> as rayon_core::job::Job>::execute
   8: rayon_core::registry::WorkerThread::wait_until_cold
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

STDOUT:

configured to use max-time: 15s
configured to use variation coefficient sample with sample: 10000, threshold: 0.05
configured to use custom heuristic
total jobs: 2, actors: 1
preparing initial solution(-s)
[0s] created initial solution in 0ms, fitness: (0.000, 23113.000)
[0s] created initial solution in 0ms, fitness: (0.000, 23113.000)
[0s] created initial solution in 0ms, fitness: (0.000, 23113.000)
[0s] created initial solution in 0ms, fitness: (0.000, 23113.000)
created initial population in 0ms
[0s] generation 0 took 0ms, median: 0ms fitness: (0.000, 23113.000)
[0s] population state (phase: initial, speed: 0.00 gen/sec, improvement ratio: 0.000:0.000):
    rank: 0, fitness: (0.000, 23113.000), difference: 0.000%
reinterpretcat commented 1 year ago

Thanks! Seems some unexpected regression. Pushed a fix to master