Skip to content

Commit

Permalink
graphhopper#464 add unassigned job reason
Browse files Browse the repository at this point in the history
  • Loading branch information
baienyang committed May 15, 2019
1 parent 23368a5 commit 3f37f32
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ public InsertionData getInsertionData(final VehicleRoute currentRoute, final Job
bestKnownCost_ = iData.getInsertionCost();
}
}
if (relevantVehicles.isEmpty()) {
bestIData.getFailedConstraintNames().add("HasNoEnoughVehicle");
}
return bestIData;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

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.*;
Expand Down Expand Up @@ -62,13 +63,15 @@ public UnassignedJobReasonTracker() {
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);
failedConstraintNamesToCode.put("ServiceLoadRouteLevelConstraint", 3);
failedConstraintNamesToCode.put("PickupAndDeliverShipmentLoadActivityLevelConstraint", 3);
failedConstraintNamesToCode.put("ServiceLoadActivityLevelConstraint", 3);
failedConstraintNamesToCode.put("MaxDistanceConstraint", 4);
failedConstraintNamesToCode.put("HasNoEnoughVehicle", 5);
}

public void ignore(String simpleNameOfConstraint) {
Expand Down

0 comments on commit 3f37f32

Please sign in to comment.