# for v in xrange(data['num_vehicles']): # stucks
for v in [0]: # works fast
Route for vehicle 0:
0 Load(0) Time(0,0) Slack(2,4) -> 12 Load(0) Time(6,8) Slack(0,2) -> 13 Load(2) Time(18,20) Slack(0,2) -> 15 Load(6) Time(45,45) Slack(0,0) -> 11 Load(14) Time(88,88) Slack(0,0) -> 0 Load(15) Time(99,99)
Route for vehicle 1:
0 Load(0) Time(0,0) Slack(0,3) -> 5 Load(0) Time(3,6) Slack(0,3) -> 8 Load(2) Time(15,18) Slack(0,3) -> 6 Load(10) Time(57,60) Slack(0,5) -> 2 Load(14) Time(80,85) Slack(0,66) -> 0 Load(15) Time(94,160)
Why, route 0, the time windows for nodes starting from 15 are dense and no such thing observed for the other routes?
ortools~7.3.7083
@Mizux @lperron S.O.S.
Please help
Are you running Python 3?
yup
Python 3 doesn't use xrange, it uses range
On Thu, 17 Oct 2019, 14:42 Shohruh, notifications@github.com wrote:
yup
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/google/or-tools/issues/1653?email_source=notifications&email_token=AAXL5ESBKOU4EARVUUNUABLQPBMS3A5CNFSM4JBPGLCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBP6O3Q#issuecomment-543156078,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAXL5EXJYSUAWMBFWQIGJELQPBMS3ANCNFSM4JBPGLCA
.
@CervEdin still the same, I tried to test for newer examples - vrptw.py, no result
@Mizux @lperron I think they are on vacation
No, just busy
Le lun. 21 oct. 2019 à 08:43, Shohruh notifications@github.com a écrit :
@Mizux https://github.com/Mizux @lperron https://github.com/lperron I
think they are on vacation—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/google/or-tools/issues/1653?email_source=notifications&email_token=ACUPL3KZZPFH2KOUXDIEO5TQPVFPNA5CNFSM4JBPGLCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBZHLPI#issuecomment-544372157,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ACUPL3LEJUUXFBF6FABNE4DQPVFPNANCNFSM4JBPGLCA
.
@CervEdin we use six see:
https://github.com/google/or-tools/blob/46173008fdb15dae1dca0e8fa42a21ed6190b6e4/ortools/constraint_solver/samples/cvrptw_break.py#L29
Python 3 range() and Python 2 xrange() use generator while Python 2 range() return a list, by using six we are sure to use genrator based range().
@lperron since we just removed the support to Python 2.7 (end of life) we could remove six and replace six xrange() by python 3 built-in range() everywhere ?
@Mizux Thanx for suggestion! Maybe I did not explain the problem but, the problem is I can not assign break for all vehicles in the example:
309 #for v in xrange(data['num_vehicles']):
310 for v in [0]:
when uncomment line 309, the search stucks.
p.s. it is not the problem with range.
p.s.s. When 5+ vehicles assigned with line 309, working!
By the way, breaks do not overlap transit variables.
@lperron @Mizux Guys almost 3 weeks passed. Could you pls land a hand?
Mizux returns to work in 3 weeks, and I do not know how to solve this
problem.
Le dim. 3 nov. 2019 à 10:09, Shohruh notifications@github.com a écrit :
@lperron https://github.com/lperron @Mizux https://github.com/Mizux
Guys almost 3 weeks passed. Could you pls land a hand?—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/google/or-tools/issues/1653?email_source=notifications&email_token=ACUPL3NKYXZHT75SSFE73DTQR2IK3A5CNFSM4JBPGLCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEC5N6ZY#issuecomment-549117799,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ACUPL3PPWPS6BCMO2IIOPLDQR2IK3ANCNFSM4JBPGLCA
.
I tried another approach with:
https://github.com/google/or-tools/blob/46173008fdb15dae1dca0e8fa42a21ed6190b6e4/ortools/constraint_solver/constraint_solver.h#L1391
the problem is still remaining, the node`s time-window is overlapping the exclusion interval for vehicle. So here is my code:
solver = routing.solver()
solver.AddConstraint(
solver.NotMemberCt(
time_dimension.CumulVar(routing.End(0)),
[20], [30]
)
)
for vehicle 0: the cumul should not be in 20-30. And the program stucks. Is that correct and how can I fix this issue?
@lperron Hey there! Sir, is Mizux back?
Finally, I manager to solve the problem by setting SoftUpperBound and SoftLowerBound. But, how to do the same with SetRanges or Min/Max?
@abduakhatov thank you for sharing, would you mind elaborating on how you were able to work around this issue?
@johngcarlsson I changed SetRange() to SetCumulVarSoftLowerBound and SetCumulVarSoftUpperBound - because the requirement to add break is to make sure that the break should not be between transits. So changing to SetCumulVarSoft softens this requirement. But with strict SetRange the problem still remains. Mizux labeled it as Bug