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

bugfix #96 - modified core.problem.vehicle.InfiniteVehicles according to

changes in core.problem.vehicle.VehicleTypeKey
This commit is contained in:
oblonski 2014-05-15 13:56:19 +02:00
parent af52639b10
commit ef05f954e9

View file

@ -45,7 +45,7 @@ class InfiniteVehicles implements VehicleFleetManager{
private void extractTypes(Collection<Vehicle> vehicles) {
for(Vehicle v : vehicles){
VehicleTypeKey typeKey = new VehicleTypeKey(v.getType().getTypeId(), v.getStartLocationId(),v.getEndLocationId());
VehicleTypeKey typeKey = new VehicleTypeKey(v.getType().getTypeId(), v.getStartLocationId(),v.getEndLocationId(), v.getEarliestDeparture(), v.getLatestArrival());
types.put(typeKey,v);
sortedTypes.add(typeKey);
@ -86,7 +86,7 @@ class InfiniteVehicles implements VehicleFleetManager{
@Deprecated
public Collection<Vehicle> getAvailableVehicles(String withoutThisType, String locationId) {
Collection<Vehicle> vehicles = new ArrayList<Vehicle>();
VehicleTypeKey thisKey = new VehicleTypeKey(withoutThisType, locationId,locationId);
VehicleTypeKey thisKey = new VehicleTypeKey(withoutThisType, locationId,locationId, 0., 0.);
for(VehicleTypeKey key : types.keySet()){
if(!key.equals(thisKey)){
vehicles.add(types.get(key));
@ -98,7 +98,7 @@ class InfiniteVehicles implements VehicleFleetManager{
@Override
public Collection<Vehicle> getAvailableVehicles(Vehicle withoutThisType) {
Collection<Vehicle> vehicles = new ArrayList<Vehicle>();
VehicleTypeKey thisKey = new VehicleTypeKey(withoutThisType.getType().getTypeId(), withoutThisType.getStartLocationId(), withoutThisType.getEndLocationId());
VehicleTypeKey thisKey = new VehicleTypeKey(withoutThisType.getType().getTypeId(), withoutThisType.getStartLocationId(), withoutThisType.getEndLocationId(), withoutThisType.getEarliestDeparture(), withoutThisType.getLatestArrival());
for(VehicleTypeKey key : types.keySet()){
if(!key.equals(thisKey)){
vehicles.add(types.get(key));