optimization
optimization copied to clipboard
'Router' does not contain a definition for 'CalculateTSP' and no accessible extension method 'CalculateTSP' accepting a first argument of type 'Router' could be found
I'm getting the below error with Itinero.Optimization 1.0.0-pre003.
var router = new Router(routerDb);
var route = router.CalculateTSP(profile, points);
'Router' does not contain a definition for 'CalculateTSP' and no accessible extension method 'CalculateTSP' accepting a first argument of type 'Router' could be found (are you missing a using directive or an assembly reference?)
I am using:
using Itinero;
using Itinero.Optimization;
using Itinero.Osm.Vehicles;
I was able to get this to work using Itinero 1.3.2
and Itinero.Optimization 0.14.5
, however, the recommended installation method on the README does not work.
PM> Install-Package Itinero.Optimization -IncludePrerelease
@MichaelAllenMiller : Could you expose the correct install method ?
I'm unsure what you mean by "expose the correct install method". Can you clarify?
@MichaelAllenMiller Sorry about this, when using the latest prerelease of this project you also need to latest prerelease of Itinero.
Also the CalculateTSP method doesn't exist anymore, keep in mind this library was still just an unstable release.
In order to solve the TSP, Update itinero to the latest libraries (including itinero.optimization and write the following code: var router = new Router(routerDb); router.Optimizer(new OptimizerConfiguration(modelMapperRegistry: new ModelMapperRegistry( new ByEdgeDirectedModelMapper(1000)))); var route = await Task.Run(() => router.Optimize(profile.FullName, locations, out _, 0, 0, turnPenalty: 60));