mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
new signatures of the VehicleRoutingAlgorithms.createAlgorithm method that allow one to specify the nThreads with AlgorithmConfig algorithmConfig or URL configURL
This commit is contained in:
parent
126b8c90c0
commit
3828bd0cb6
1 changed files with 9 additions and 0 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue