Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some unassignedJob maybe not reason when using fastRegretInsertion #464

Open
baiyyang opened this issue May 15, 2019 · 2 comments
Open

Some unassignedJob maybe not reason when using fastRegretInsertion #464

baiyyang opened this issue May 15, 2019 · 2 comments

Comments

@baiyyang
Copy link

Hi, oblonski,
  I'm using the Jsprit for VRP. But now, when I use fast regretInsertion strategy, maybe some unassigned jobs have no reason. I think the reason that the method of vehicleDependentInsertionCostCalculator.
  When calculating the best insertionData by vehicleDependentInsertionCostCalculator using FastRegretInsertion strategy, some unassignedJob can't be assigned on current routes and it has enough vehicle used for empty route. So which causes no reason of the unassignedJob.
  And I update the VehicleDependentInsertionCostCalculator below, maybe it will help you.

 for (Vehicle v : relevantVehicles) {   // relevantVehicles is empty
      // can't be assigned
  }
  if (relevantVehicles.isEmpty()) {
        bestIData.getFailedConstraintNames().add("HasNoEnoughVehicle");  // add reason
  }
  return bestIData; 
baiyyang pushed a commit to baiyyang/jsprit that referenced this issue May 15, 2019
@oblonski
Copy link
Member

oblonski commented Jun 7, 2019

You can easily add your own reason handler via UnassignedJobReasonTracker like this:

UnassignedJobReasonTracker reasonTracker = new UnassignedJobReasonTracker();
reasonTracker.put("SimpleNameOfYourConstraint",21,"could not be assigned due to your constraint");

@baiyyang
Copy link
Author

baiyyang commented Jun 9, 2019

Oh, thank you for your reply. I think you may not understand my question. I think that maybe there are some unassigned jobs and UnassignedJobReasonTracker hasn't record any reason. In other word, the unassigned job hasn't reached the ConstraintManager to record the reason. In my submission it's a bug.
: )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants