mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
fixed bug #112
This commit is contained in:
parent
fee2a396d9
commit
bca9323c67
5 changed files with 20 additions and 12 deletions
|
|
@ -60,8 +60,7 @@ public final class InsertionInitialSolutionFactory implements InitialSolutionFac
|
|||
}
|
||||
|
||||
private List<Job> getUnassignedJobs(VehicleRoutingProblem vrp) {
|
||||
List<Job> jobs = new ArrayList<Job>(vrp.getJobs().values());
|
||||
return jobs;
|
||||
return new ArrayList<Job>(vrp.getJobs().values());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,8 +16,6 @@
|
|||
******************************************************************************/
|
||||
package jsprit.core.algorithm.box;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import jsprit.core.algorithm.VehicleRoutingAlgorithm;
|
||||
import jsprit.core.algorithm.io.AlgorithmConfig;
|
||||
import jsprit.core.algorithm.io.AlgorithmConfigXmlReader;
|
||||
|
|
@ -25,6 +23,8 @@ import jsprit.core.algorithm.io.VehicleRoutingAlgorithms;
|
|||
import jsprit.core.problem.VehicleRoutingProblem;
|
||||
import jsprit.core.util.Resource;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -51,7 +51,7 @@ public class SchrimpfFactory {
|
|||
/**
|
||||
* Creates the {@link VehicleRoutingAlgorithm}.
|
||||
*
|
||||
* @param vrp
|
||||
* @param vrp the underlying vehicle routing problem
|
||||
* @return algorithm
|
||||
*/
|
||||
public VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vrp){
|
||||
|
|
|
|||
|
|
@ -474,7 +474,7 @@ public class VehicleRoutingAlgorithms {
|
|||
ConstraintManager constraintManager = new ConstraintManager(vrp,stateManager);
|
||||
constraintManager.addTimeWindowConstraint();
|
||||
constraintManager.addLoadConstraint();
|
||||
constraintManager.addSkillsConstraint();
|
||||
// constraintManager.addSkillsConstraint();
|
||||
|
||||
return readAndCreateAlgorithm(vrp, config, nuOfThreads, null, stateManager, constraintManager, true);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ final class VehicleTypeDependentJobInsertionCalculator implements JobInsertionCo
|
|||
this.insertionCalculator = jobInsertionCalc;
|
||||
this.vrp = vrp;
|
||||
getInitialVehicleIds();
|
||||
logger.info("inialise " + this);
|
||||
logger.info("initialise " + this);
|
||||
}
|
||||
|
||||
private void getInitialVehicleIds() {
|
||||
|
|
@ -77,6 +77,7 @@ final class VehicleTypeDependentJobInsertionCalculator implements JobInsertionCo
|
|||
/**
|
||||
* @return the vehicleSwitchAllowed
|
||||
*/
|
||||
@SuppressWarnings("UnusedDeclaration")
|
||||
public boolean isVehicleSwitchAllowed() {
|
||||
return vehicleSwitchAllowed;
|
||||
}
|
||||
|
|
@ -124,8 +125,7 @@ final class VehicleTypeDependentJobInsertionCalculator implements JobInsertionCo
|
|||
}
|
||||
|
||||
private boolean isVehicleWithInitialRoute(Vehicle selectedVehicle) {
|
||||
if(initialVehicleIds.contains(selectedVehicle.getId())) return true;
|
||||
return false;
|
||||
return initialVehicleIds.contains(selectedVehicle.getId());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -673,8 +673,17 @@ public class VehicleRoutingProblem {
|
|||
return Collections.unmodifiableMap(jobs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a copy of initial vehicle routes.
|
||||
*
|
||||
* @return copied collection of initial vehicle routes
|
||||
*/
|
||||
public Collection<VehicleRoute> getInitialVehicleRoutes(){
|
||||
return Collections.unmodifiableCollection(initialVehicleRoutes);
|
||||
Collection<VehicleRoute> copiedInitialRoutes = new ArrayList<VehicleRoute>();
|
||||
for(VehicleRoute route : initialVehicleRoutes){
|
||||
copiedInitialRoutes.add(VehicleRoute.copyOf(route));
|
||||
}
|
||||
return copiedInitialRoutes;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue