optimization icon indicating copy to clipboard operation
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

Open MichaelAllenMiller opened this issue 6 years ago • 6 comments

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 avatar Jan 24 '19 22:01 MichaelAllenMiller

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 avatar Jan 25 '19 16:01 MichaelAllenMiller

@MichaelAllenMiller : Could you expose the correct install method ?

manuprendlair avatar Jan 28 '19 15:01 manuprendlair

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

MichaelAllenMiller avatar Feb 21 '19 14:02 MichaelAllenMiller

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

xivk avatar Feb 25 '19 11:02 xivk

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

xivk avatar Feb 25 '19 11:02 xivk

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

upswing1 avatar Dec 02 '23 01:12 upswing1