itinero / optimization

Routing optimization module module for Itinero.
Apache License 2.0
51 stars 17 forks source link

'Router' does not contain a definition for 'CalculateTSP' and no accessible extension method 'CalculateTSP' accepting a first argument of type 'Router' could be found #32

Open MichaelAllenMiller opened 5 years ago

MichaelAllenMiller commented 5 years ago

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;
MichaelAllenMiller commented 5 years ago

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
manuprendlair commented 5 years ago

@MichaelAllenMiller : Could you expose the correct install method ?

MichaelAllenMiller commented 5 years ago

I'm unsure what you mean by "expose the correct install method". Can you clarify?

xivk commented 5 years ago

@MichaelAllenMiller Sorry about this, when using the latest prerelease of this project you also need to latest prerelease of Itinero.

xivk commented 5 years ago

Also the CalculateTSP method doesn't exist anymore, keep in mind this library was still just an unstable release.

upswing1 commented 8 months ago

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));