Skip to content

Commit

Permalink
Fixed bug in other test case by using ManyToMany instead of `Calcul…
Browse files Browse the repository at this point in the history
…ateManyToMany`
  • Loading branch information
Julius Friedman authored and Julius Friedman committed Mar 11, 2020
1 parent 264ef4c commit 11fe52e
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions src/Itinero/Router.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1320,13 +1320,24 @@ public override Result<float[][]> TryCalculateWeight(IProfileInstance profileIns
}
weights = algorithm.Weights;
}
//else if (contracted.HasNodeBasedGraph &&
// contracted.NodeBasedIsEdgedBased)
//{ // use vertex-based graph for edge-based routing.
// weights = Itinero.Algorithms.Contracted.Dual.RouterExtensions.CalculateManyToMany(contracted,
// _db, profileInstance.Profile,
// weightHandler, sources, targets, maxSearch, cancellationToken).Value;
//}
else if (contracted.HasNodeBasedGraph &&
contracted.NodeBasedIsEdgedBased)
{ // use vertex-based graph for edge-based routing.
//weights = Itinero.Algorithms.Contracted.Dual.RouterExtensions.CalculateManyToMany(contracted,
// _db, profileInstance.Profile,
// weightHandler, sources, targets, maxSearch, cancellationToken).Value;

var algorithm = new Itinero.Algorithms.Default.ManyToMany<float>(_db, weightHandler, sources, targets, maxSearch);
algorithm.Run(cancellationToken);
if (!algorithm.HasSucceeded)
{
return new Result<float[][]>(algorithm.ErrorMessage, (message) =>
{
return new RouteNotFoundException(message);
});
}
weights = algorithm.Weights;
}
else
{ // use node-based routing.
var algorithm = new Itinero.Algorithms.Contracted.ManyToManyWeightsBidirectionalDykstra<float>(_db, profileInstance.Profile, weightHandler,
Expand Down

0 comments on commit 11fe52e

Please sign in to comment.