Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated to NTS 2.0 and removed use of GeoAPI where required. Also Fixed 4 Bugs and Fixed most of the Unit Tests #302

Open
wants to merge 31 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
d570549
Updated to NTS 2.0
Mar 6, 2020
e7165e8
Added GetTestRandomRoutesParallel to list of tests to run
Mar 6, 2020
e613e4e
Added Locomotive and Train, Enhanced tests to run on all profiles.
Mar 6, 2020
ac863da
Enhaced RouterDb to consider Train and Locomotive during testing
Mar 6, 2020
5a185e8
Enhanced tests to run on all profiles
Mar 6, 2020
e5e2012
WeightMatrixTests now test all profiles
Mar 6, 2020
74ccc08
Added parallel test in Resolving which also does routing.
Mar 6, 2020
4790d0d
Updated STRM, Fixed multithreading issue in ProfileFactorAndSpeedCach…
juliusfriedman Mar 7, 2020
ad6c728
Updated packages in ItineroTest
juliusfriedman Mar 7, 2020
6688ba5
Removed duplicate test
Mar 9, 2020
78c4758
Updated OSM Sharp References
Mar 9, 2020
722d2d3
Fixed local references to use nuget
Mar 9, 2020
f954b1b
Updated InstructionTest to use ParallelEnumerable as indicated.
Mar 9, 2020
abaf11b
Enhanced ShapeFileWriterTests to use all profiles.
Mar 9, 2020
a96dc7b
Removed new field which hides base member. Ensured all tests are pass…
Mar 10, 2020
431becf
Used compound assignment in TestFactorAndSpeed and made TestFactorAnd…
Mar 10, 2020
f193ea0
Added test for edge based contractions and their weight matrixes
Mar 10, 2020
d309b08
Changed float.MaxValue to _weightHandler.Infinite as in other Algorit…
Mar 10, 2020
cf9efe6
Removed buggy code which was causing different weights for contracted…
Mar 10, 2020
2fe7e3d
Fixed Coordinate.DistanceEstimateInMeter added TestGeoCoordinateDista…
Mar 10, 2020
fc55f3d
Renamed TestEdgeBasedContractions to TestEdgeBasedContractionsMinimal…
Mar 11, 2020
4129ea9
Added comments for clarify in TestEdgeBasedContractions
Mar 11, 2020
62f4c08
Changed usaged of WasFound to inline expression.
Mar 11, 2020
264ef4c
Simplified calulcation in Coordinate by using a const DegreesToRadians
Mar 11, 2020
11fe52e
Fixed bug in other test case by using `ManyToMany` instead of `Calcul…
Mar 11, 2020
d8eb734
Added Parallel test
Mar 12, 2020
34e1347
Addressed https://github.com/itinero/routing/issues/306
juliusfriedman Apr 2, 2020
229fc58
Added osm.pbf files used in tests for https://github.com/itinero/rout…
juliusfriedman Apr 3, 2020
204265a
Everything passes except RouterTests.TestBicycleWithCyclenetwork
May 17, 2020
21c634d
Revised Math.Pow 2 calls to X * X, even though the later JIT's optomi…
May 17, 2020
82d4049
netcoreapp 3.1 x64 and corrected nugets and references
Jul 22, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 &&
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was removed and the issue no longer manifested in the simple case

// 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 &&
xivk marked this conversation as resolved.
Show resolved Hide resolved
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);
Copy link
Author

@juliusfriedman juliusfriedman Apr 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you can see from the commented code above CalculateManyToMany was previously being used but returned different results which didn't match that of the non contracted versions. This change fixed both the simple and complex cases I was made aware of.

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