public class UnassignedJobReasonTracker extends Object implements JobUnassignedListener
| Constructor and Description |
|---|
UnassignedJobReasonTracker() |
| Modifier and Type | Method and Description |
|---|---|
int |
getCode(String failedConstraintName) |
Map<Integer,String> |
getCodesToReason()
Returns an unmodifiable map of codes and reason pairs.
|
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.
|
Map<String,Integer> |
getFailedConstraintNamesToCode()
Returns an unmodifiable map of constraint names (simple name of constraint) and reason code pairs.
|
String |
getHumanReadableReason(int code) |
String |
getHumanReadableReason(String failedConstraintName) |
static String |
getMostLikelyFailedConstraintName(org.apache.commons.math3.stat.Frequency failedConstraintNamesFrequency) |
String |
getMostLikelyReason(String jobId)
Returns the most likely reason i.e.
|
int |
getMostLikelyReasonCode(String jobId)
Returns the most likely reason code i.e.
|
Map<String,org.apache.commons.math3.stat.Frequency> |
getReasons()
Deprecated.
|
void |
ignore(String simpleNameOfConstraint) |
void |
informJobUnassigned(Job unassigned,
Collection<String> failedConstraintNames) |
void |
put(String simpleNameOfFailedConstraint,
int code,
String reason) |
public static String getMostLikelyFailedConstraintName(org.apache.commons.math3.stat.Frequency failedConstraintNamesFrequency)
public void ignore(String simpleNameOfConstraint)
public void informJobUnassigned(Job unassigned, Collection<String> failedConstraintNames)
informJobUnassigned in interface JobUnassignedListener@Deprecated public Map<String,org.apache.commons.math3.stat.Frequency> getReasons()
public Map<String,org.apache.commons.math3.stat.Frequency> getFailedConstraintNamesFrequencyMapping()
public Map<Integer,String> getCodesToReason()
public Map<String,Integer> getFailedConstraintNamesToCode()
public int getCode(String failedConstraintName)
public String getHumanReadableReason(int code)
public int getMostLikelyReasonCode(String jobId)
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"
jobId - Copyright © 2013–2020. All rights reserved.