mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
rename badJob into unassignedJob
This commit is contained in:
parent
650a20fabc
commit
b7b0ff650c
6 changed files with 25 additions and 23 deletions
|
|
@ -52,7 +52,7 @@ public class VariablePlusFixedSolutionCostCalculatorFactory {
|
|||
c += stateManager.getRouteState(r, InternalStates.COSTS, Double.class);
|
||||
c += getFixedCosts(r.getVehicle());
|
||||
}
|
||||
c += solution.getBadJobs().size() * c * .1;
|
||||
c += solution.getUnassignedJobs().size() * c * .1;
|
||||
return c;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -50,10 +50,10 @@ public class RuinAndRecreateModule implements SearchStrategyModule{
|
|||
Collection<Job> ruinedJobs = ruin.ruin(vrpSolution.getRoutes());
|
||||
Set<Job> ruinedJobSet = new HashSet<Job>();
|
||||
ruinedJobSet.addAll(ruinedJobs);
|
||||
ruinedJobSet.addAll(vrpSolution.getBadJobs());
|
||||
Collection<Job> badJobs = insertion.insertJobs(vrpSolution.getRoutes(), ruinedJobSet);
|
||||
vrpSolution.getBadJobs().clear();
|
||||
vrpSolution.getBadJobs().addAll(badJobs);
|
||||
ruinedJobSet.addAll(vrpSolution.getUnassignedJobs());
|
||||
Collection<Job> unassignedJobs = insertion.insertJobs(vrpSolution.getRoutes(), ruinedJobSet);
|
||||
vrpSolution.getUnassignedJobs().clear();
|
||||
vrpSolution.getUnassignedJobs().addAll(unassignedJobs);
|
||||
return vrpSolution;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ public class VehicleRoutingProblemSolution {
|
|||
|
||||
private final Collection<VehicleRoute> routes;
|
||||
|
||||
private Collection<Job> badJobs = new ArrayList<Job>();
|
||||
private Collection<Job> unassignedJobs = new ArrayList<Job>();
|
||||
|
||||
private double cost;
|
||||
|
||||
|
|
@ -54,7 +54,7 @@ public class VehicleRoutingProblemSolution {
|
|||
routes.add(route);
|
||||
}
|
||||
this.cost = solution.getCost();
|
||||
badJobs.addAll(solution.getBadJobs());
|
||||
unassignedJobs.addAll(solution.getUnassignedJobs());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -73,12 +73,14 @@ public class VehicleRoutingProblemSolution {
|
|||
* Constructs a solution with a number of {@link VehicleRoute}s, bad jobs and their corresponding aggregate cost value.
|
||||
*
|
||||
* @param routes routes being part of the solution
|
||||
* @param unassignedJobs jobs that could not be assigned to any vehicle
|
||||
* @param cost total costs of solution
|
||||
*
|
||||
*/
|
||||
public VehicleRoutingProblemSolution(Collection<VehicleRoute> routes, Collection<Job> badJobs, double cost) {
|
||||
public VehicleRoutingProblemSolution(Collection<VehicleRoute> routes, Collection<Job> unassignedJobs, double cost) {
|
||||
super();
|
||||
this.routes = routes;
|
||||
this.badJobs = badJobs;
|
||||
this.unassignedJobs = unassignedJobs;
|
||||
this.cost = cost;
|
||||
}
|
||||
|
||||
|
|
@ -114,8 +116,8 @@ public class VehicleRoutingProblemSolution {
|
|||
*
|
||||
* @return bad jobs
|
||||
*/
|
||||
public Collection<Job> getBadJobs(){
|
||||
return badJobs;
|
||||
public Collection<Job> getUnassignedJobs(){
|
||||
return unassignedJobs;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue