Class UnassignedJobReasonTracker

java.lang.Object
com.graphhopper.jsprit.core.util.UnassignedJobReasonTracker
All Implemented Interfaces:
SearchStrategyModuleListener, VehicleRoutingAlgorithmListener, InsertionListener, JobUnassignedListener

public class UnassignedJobReasonTracker extends Object implements JobUnassignedListener
Created by schroeder on 06/02/17.
  • Constructor Details

    • UnassignedJobReasonTracker

      public UnassignedJobReasonTracker()
  • Method Details

    • getMostLikelyFailedConstraintName

      public static String getMostLikelyFailedConstraintName(org.apache.commons.math3.stat.Frequency failedConstraintNamesFrequency)
    • ignore

      public void ignore(String simpleNameOfConstraint)
    • informJobUnassigned

      public void informJobUnassigned(Job unassigned, Collection<String> failedConstraintNames)
      Specified by:
      informJobUnassigned in interface JobUnassignedListener
    • put

      public void put(String simpleNameOfFailedConstraint, int code, String reason)
    • getReasons

      @Deprecated public Map<String,org.apache.commons.math3.stat.Frequency> getReasons()
      Deprecated.
      For each job id, it returns frequency distribution of failed constraints (simple name of constraint) in an unmodifiable map.
      Returns:
    • getFailedConstraintNamesFrequencyMapping

      public Map<String,org.apache.commons.math3.stat.Frequency> getFailedConstraintNamesFrequencyMapping()
      For each job id, it returns frequency distribution of failed constraints (simple name of constraint) in an unmodifiable map.
      Returns:
    • getCodesToReason

      public Map<Integer,String> getCodesToReason()
      Returns an unmodifiable map of codes and reason pairs.
      Returns:
    • getFailedConstraintNamesToCode

      public Map<String,Integer> getFailedConstraintNamesToCode()
      Returns an unmodifiable map of constraint names (simple name of constraint) and reason code pairs.
      Returns:
    • getCode

      public int getCode(String failedConstraintName)
    • getHumanReadableReason

      public String getHumanReadableReason(int code)
    • getHumanReadableReason

      public String getHumanReadableReason(String failedConstraintName)
    • getMostLikelyReasonCode

      public int getMostLikelyReasonCode(String jobId)
      Returns the most likely reason code i.e. the reason (failed constraint) being observed most often.

      1 --> "cannot serve required skill 2 --> "cannot be visited within time window" 3 --> "does not fit into any vehicle due to capacity" 4 --> "cannot be assigned due to max distance constraint of vehicle"

      Parameters:
      jobId -
      Returns:
    • getMostLikelyReason

      public String getMostLikelyReason(String jobId)
      Returns the most likely reason i.e. the reason (failed constraint) being observed most often.
      Parameters:
      jobId -
      Returns: