Skip to content

Commit

Permalink
#278 monitor route analysis - wip
Browse files Browse the repository at this point in the history
  • Loading branch information
vmarc committed Feb 10, 2024
1 parent 17ac780 commit 271391f
Show file tree
Hide file tree
Showing 4 changed files with 563 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ class StructureElementAnalyzer(wayMembers: Seq[WayMember], traceEnabled: Boolean
case None =>
elementDirection = Some(ElementDirection.Forward)
case Some(previousBackwardFragment) =>
if (previousBackwardFragment.backwardEndNodeId == link.nodeIds.last) {
if (previousBackwardFragment.backwardStartNodeId == link.nodeIds.last) {
elementDirection = Some(ElementDirection.Backward)
}
else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ class Structure_31_GapSecondWayBackwardTest extends UnitTest {
Seq(
Seq(
"1>3",
),
Seq(
"5>3 (Forward)"
"5>3 (Backward)"
)
)
)
Expand All @@ -36,8 +34,20 @@ class Structure_31_GapSecondWayBackwardTest extends UnitTest {
val structure = setup.structure()
structure.shouldMatchTo(
TestStructure(
forwardPath = None,
backwardPath = None,
forwardPath = Some(
TestStructurePath(
startNodeId = 1,
endNodeId = 3,
nodeIds = Seq(1, 2, 3)
)
),
backwardPath = Some(
TestStructurePath(
startNodeId = 5,
endNodeId = 1,
nodeIds = Seq(5, 4, 3, 2, 1)
)
)
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package kpn.server.analyzer.engine.monitor.structure
import kpn.api.custom.Tags
import kpn.core.util.UnitTest

// reproduces situation in anaylsis route 6701558
// reproduces situation in node network route 6701558
class Structure_78_Split_Test extends UnitTest {

private def setup = new StructureTestSetupBuilder() {
Expand Down

0 comments on commit 271391f

Please sign in to comment.