mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
#464 add unassigned job reason
This commit is contained in:
parent
23368a5409
commit
3f37f32212
2 changed files with 6 additions and 0 deletions
|
|
@ -123,6 +123,9 @@ final class VehicleTypeDependentJobInsertionCalculator implements JobInsertionCo
|
|||
bestKnownCost_ = iData.getInsertionCost();
|
||||
}
|
||||
}
|
||||
if (relevantVehicles.isEmpty()) {
|
||||
bestIData.getFailedConstraintNames().add("HasNoEnoughVehicle");
|
||||
}
|
||||
return bestIData;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ package com.graphhopper.jsprit.core.util;
|
|||
|
||||
import com.graphhopper.jsprit.core.algorithm.recreate.listener.JobUnassignedListener;
|
||||
import com.graphhopper.jsprit.core.problem.job.Job;
|
||||
|
||||
import org.apache.commons.math3.stat.Frequency;
|
||||
|
||||
import java.util.*;
|
||||
|
|
@ -62,6 +63,7 @@ public class UnassignedJobReasonTracker implements JobUnassignedListener {
|
|||
codesToHumanReadableReason.put(2, "cannot be visited within time window");
|
||||
codesToHumanReadableReason.put(3, "does not fit into any vehicle due to capacity");
|
||||
codesToHumanReadableReason.put(4, "cannot be assigned due to max distance constraint of vehicle");
|
||||
codesToHumanReadableReason.put(5, "cannot be assigned due to less vehicle");
|
||||
|
||||
failedConstraintNamesToCode.put("HardSkillConstraint", 1);
|
||||
failedConstraintNamesToCode.put("VehicleDependentTimeWindowConstraints", 2);
|
||||
|
|
@ -69,6 +71,7 @@ public class UnassignedJobReasonTracker implements JobUnassignedListener {
|
|||
failedConstraintNamesToCode.put("PickupAndDeliverShipmentLoadActivityLevelConstraint", 3);
|
||||
failedConstraintNamesToCode.put("ServiceLoadActivityLevelConstraint", 3);
|
||||
failedConstraintNamesToCode.put("MaxDistanceConstraint", 4);
|
||||
failedConstraintNamesToCode.put("HasNoEnoughVehicle", 5);
|
||||
}
|
||||
|
||||
public void ignore(String simpleNameOfConstraint) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue