mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
set_insertion_index_on_break_insertion (#83)
This commit is contained in:
parent
eff17bc299
commit
2a04804748
1 changed files with 4 additions and 0 deletions
|
|
@ -26,6 +26,7 @@ import com.graphhopper.jsprit.core.problem.cost.VehicleRoutingTransportCosts;
|
||||||
import com.graphhopper.jsprit.core.problem.driver.Driver;
|
import com.graphhopper.jsprit.core.problem.driver.Driver;
|
||||||
import com.graphhopper.jsprit.core.problem.job.Break;
|
import com.graphhopper.jsprit.core.problem.job.Break;
|
||||||
import com.graphhopper.jsprit.core.problem.job.Job;
|
import com.graphhopper.jsprit.core.problem.job.Job;
|
||||||
|
import com.graphhopper.jsprit.core.problem.misc.ActivityContext;
|
||||||
import com.graphhopper.jsprit.core.problem.misc.JobInsertionContext;
|
import com.graphhopper.jsprit.core.problem.misc.JobInsertionContext;
|
||||||
import com.graphhopper.jsprit.core.problem.solution.route.VehicleRoute;
|
import com.graphhopper.jsprit.core.problem.solution.route.VehicleRoute;
|
||||||
import com.graphhopper.jsprit.core.problem.solution.route.activity.BreakActivity;
|
import com.graphhopper.jsprit.core.problem.solution.route.activity.BreakActivity;
|
||||||
|
|
@ -144,6 +145,9 @@ final class BreakInsertionCalculator implements JobInsertionCostsCalculator {
|
||||||
tourEnd = true;
|
tourEnd = true;
|
||||||
}
|
}
|
||||||
boolean breakThis = true;
|
boolean breakThis = true;
|
||||||
|
ActivityContext activityContext = new ActivityContext();
|
||||||
|
activityContext.setInsertionIndex(actIndex);
|
||||||
|
insertionContext.setActivityContext(activityContext);
|
||||||
List<Location> locations = Arrays.asList(prevAct.getLocation(), nextAct.getLocation());
|
List<Location> locations = Arrays.asList(prevAct.getLocation(), nextAct.getLocation());
|
||||||
for (Location location : locations) {
|
for (Location location : locations) {
|
||||||
breakAct2Insert.setLocation(location);
|
breakAct2Insert.setLocation(location);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue