How to pass multiple Time Matrix (N*N) to optaplanner

107 views Asked by At

I want to make the route timing (arrival) updated with the current traffic in the city.So I fetched Multiple Time Matrix from Google API.Now while routing the Arrival time should be calculated from the Matrix fetched for that time Interval. For Example : I have fetched 3 Time Matrix. 10:00 {N * N} 12:00 {N * N} and 14:00{N * N} If previousCustomer's arrival time is 11:00 then for next customer the time should be fetched from Matrix 12:00{}.

So How could I do this using Optaplanner ? Let me know if anyone one need more explanation. Thanks

1

There are 1 answers

0
Geoffrey De Smet On BEST ANSWER

Using that matrix from OptaPlanner isn't hard. Just refactor RoadLocation.getDistanceTo(RoadLocation) to something like RoadLocation.getDistanceTo(RoadLocation, LocalDateTime startingTime) and adjust your score rules accordingly.

The big problem is memory while scaling out. If you have 10k locations, then only 1 time interval already costs almost 2GB RAM memory...