1
0
Fork 0
mirror of https://github.com/graphhopper/jsprit.git synced 2020-01-24 07:45:05 +01:00

adjust vehicle array - related to #292

This commit is contained in:
oblonski 2016-11-08 12:16:59 +01:00
parent f8ea447cb9
commit 651b52530f
No known key found for this signature in database
GPG key ID: 179DE487285680D1

View file

@ -52,7 +52,7 @@ public class MaxDistanceConstraint implements HardActivityConstraint{
private void makeArray(Map<Vehicle, Double> maxDistances) { private void makeArray(Map<Vehicle, Double> maxDistances) {
int maxIndex = getMaxIndex(maxDistances.keySet()); int maxIndex = getMaxIndex(maxDistances.keySet());
this.maxDistances = new Double[maxIndex]; this.maxDistances = new Double[maxIndex+1];
for(Vehicle v : maxDistances.keySet()){ for(Vehicle v : maxDistances.keySet()){
this.maxDistances[v.getIndex()]=maxDistances.get(v); this.maxDistances[v.getIndex()]=maxDistances.get(v);
} }