1
0
Fork 0
mirror of https://github.com/graphhopper/jsprit.git synced 2020-01-24 07:45:05 +01:00

Merge pull request #118 from pierredavidbelanger/readAndCreateAlgorithm-new-signatures-with-nThreads

new signatures of the VehicleRoutingAlgorithms.createAlgorithm method th...
This commit is contained in:
jsprit 2014-08-07 08:51:01 +02:00
commit f1a8bacfe2

View file

@ -368,6 +368,9 @@ public class VehicleRoutingAlgorithms {
public static VehicleRoutingAlgorithm createAlgorithm(final VehicleRoutingProblem vrp, final AlgorithmConfig algorithmConfig){
return createAlgo(vrp,algorithmConfig.getXMLConfiguration(),0, null);
}
public static VehicleRoutingAlgorithm createAlgorithm(final VehicleRoutingProblem vrp, int nThreads, final AlgorithmConfig algorithmConfig){
return createAlgo(vrp,algorithmConfig.getXMLConfiguration(),nThreads, null);
}
/**
* Read and creates a {@link VehicleRoutingAlgorithm} from an url.
@ -382,6 +385,12 @@ public class VehicleRoutingAlgorithms {
xmlReader.read(configURL);
return createAlgo(vrp,algorithmConfig.getXMLConfiguration(),0, null);
}
public static VehicleRoutingAlgorithm readAndCreateAlgorithm(final VehicleRoutingProblem vrp, int nThreads, final URL configURL){
AlgorithmConfig algorithmConfig = new AlgorithmConfig();
AlgorithmConfigXmlReader xmlReader = new AlgorithmConfigXmlReader(algorithmConfig);
xmlReader.read(configURL);
return createAlgo(vrp,algorithmConfig.getXMLConfiguration(),nThreads, null);
}
/**
* Read and creates {@link jsprit.core.problem.VehicleRoutingProblem} from config-file.