diff --git a/graph/path/a_star_test.go b/graph/path/a_star_test.go index e4bd3c57..95a75f9f 100644 --- a/graph/path/a_star_test.go +++ b/graph/path/a_star_test.go @@ -10,7 +10,6 @@ import ( "testing" "gonum.org/v1/gonum/graph" - "gonum.org/v1/gonum/graph/path/internal" "gonum.org/v1/gonum/graph/path/internal/testgraphs" "gonum.org/v1/gonum/graph/simple" "gonum.org/v1/gonum/graph/topo" @@ -27,7 +26,7 @@ var aStarTests = []struct { { name: "simple path", g: func() graph.Graph { - return internal.NewGridFrom( + return testgraphs.NewGridFrom( "*..*", "**.*", "**.*", @@ -40,20 +39,20 @@ var aStarTests = []struct { }, { name: "small open graph", - g: internal.NewGrid(3, 3, true), + g: testgraphs.NewGrid(3, 3, true), s: 0, t: 8, }, { name: "large open graph", - g: internal.NewGrid(1000, 1000, true), + g: testgraphs.NewGrid(1000, 1000, true), s: 0, t: 999*1000 + 999, }, { name: "no path", g: func() graph.Graph { - tg := internal.NewGrid(5, 5, true) + tg := testgraphs.NewGrid(5, 5, true) // Create a complete "wall" across the middle row. tg.Set(2, 0, false) @@ -70,7 +69,7 @@ var aStarTests = []struct { { name: "partially obstructed", g: func() graph.Graph { - tg := internal.NewGrid(10, 10, true) + tg := testgraphs.NewGrid(10, 10, true) // Create a partial "wall" across the middle // row with a gap at the left-hand end. @@ -92,7 +91,7 @@ var aStarTests = []struct { { name: "partially obstructed with heuristic", g: func() graph.Graph { - tg := internal.NewGrid(10, 10, true) + tg := testgraphs.NewGrid(10, 10, true) // Create a partial "wall" across the middle // row with a gap at the left-hand end. diff --git a/graph/path/dynamic/dstarlite_test.go b/graph/path/dynamic/dstarlite_test.go index 90442d7b..1ceb2b1d 100644 --- a/graph/path/dynamic/dstarlite_test.go +++ b/graph/path/dynamic/dstarlite_test.go @@ -15,7 +15,6 @@ import ( "gonum.org/v1/gonum/graph" "gonum.org/v1/gonum/graph/path" - "gonum.org/v1/gonum/graph/path/internal" "gonum.org/v1/gonum/graph/path/internal/testgraphs" "gonum.org/v1/gonum/graph/simple" ) @@ -88,12 +87,12 @@ func TestDStarLiteNullHeuristic(t *testing.T) { } var dynamicDStarLiteTests = []struct { - g *internal.Grid + g *testgraphs.Grid radius float64 all bool diag, unit bool remember []bool - modify func(*internal.LimitedVisionGrid) + modify func(*testgraphs.LimitedVisionGrid) heuristic func(dx, dy float64) float64 @@ -105,7 +104,7 @@ var dynamicDStarLiteTests = []struct { }{ { // This is the example shown in figures 6 and 7 of doi:10.1109/tro.2004.838026. - g: internal.NewGridFrom( + g: testgraphs.NewGridFrom( "...", ".*.", ".*.", @@ -139,7 +138,7 @@ var dynamicDStarLiteTests = []struct { // may be taken incorrectly at 90° or correctly at 45° because the // calculated rhs values of 12 and 17 are tied when moving from node // 16, and the grid is small enough to examine by a dump. - g: internal.NewGridFrom( + g: testgraphs.NewGridFrom( ".....", "...*.", "**.*.", @@ -176,7 +175,7 @@ var dynamicDStarLiteTests = []struct { // with the exception that diagonal edge weights are calculated with the hypot // function instead of a step count and only allowing information to be known // from exploration. - g: internal.NewGridFrom( + g: testgraphs.NewGridFrom( "..................", "..................", "..................", @@ -239,7 +238,7 @@ var dynamicDStarLiteTests = []struct { // with the exception that diagonal edge weights are calculated with the hypot // function instead of a step count, not closing the exit and only allowing // information to be known from exploration. - g: internal.NewGridFrom( + g: testgraphs.NewGridFrom( "..................", "..................", "..................", @@ -299,7 +298,7 @@ var dynamicDStarLiteTests = []struct { // with the exception that diagonal edge weights are calculated with the hypot // function instead of a step count, the exit is closed at a distance and // information is allowed to be known from exploration. - g: internal.NewGridFrom( + g: testgraphs.NewGridFrom( "..................", "..................", "..................", @@ -363,7 +362,7 @@ var dynamicDStarLiteTests = []struct { // This is the example shown in figure 2 of doi:10.1109/tro.2004.838026 // with the exception that diagonal edge weights are calculated with the hypot // function instead of a step count. - g: internal.NewGridFrom( + g: testgraphs.NewGridFrom( "..................", "..................", "..................", @@ -385,7 +384,7 @@ var dynamicDStarLiteTests = []struct { diag: true, remember: []bool{true}, - modify: func(l *internal.LimitedVisionGrid) { + modify: func(l *testgraphs.LimitedVisionGrid) { all := l.Grid.AllVisible l.Grid.AllVisible = false for _, n := range l.Nodes() { @@ -459,7 +458,7 @@ var dynamicDStarLiteTests = []struct { weight: 21.242640687119287, }, { - g: internal.NewGridFrom( + g: testgraphs.NewGridFrom( "*..*", "**.*", "**.*", @@ -487,7 +486,7 @@ var dynamicDStarLiteTests = []struct { weight: 4, }, { - g: internal.NewGridFrom( + g: testgraphs.NewGridFrom( "*..*", "**.*", "**.*", @@ -514,7 +513,7 @@ var dynamicDStarLiteTests = []struct { weight: math.Sqrt2 + 2, }, { - g: internal.NewGridFrom( + g: testgraphs.NewGridFrom( "...", ".*.", ".*.", @@ -555,7 +554,7 @@ var dynamicDStarLiteTests = []struct { func TestDStarLiteDynamic(t *testing.T) { for i, test := range dynamicDStarLiteTests { for _, remember := range test.remember { - l := &internal.LimitedVisionGrid{ + l := &testgraphs.LimitedVisionGrid{ Grid: test.g, VisionRadius: test.radius, Location: test.s, diff --git a/graph/path/dynamic/dumper_test.go b/graph/path/dynamic/dumper_test.go index b7fa9392..1ab77210 100644 --- a/graph/path/dynamic/dumper_test.go +++ b/graph/path/dynamic/dumper_test.go @@ -11,7 +11,7 @@ import ( "sort" "text/tabwriter" - "gonum.org/v1/gonum/graph/path/internal" + "gonum.org/v1/gonum/graph/path/internal/testgraphs" "gonum.org/v1/gonum/graph/simple" ) @@ -20,7 +20,7 @@ type dumper struct { step int dStarLite *DStarLite - grid *internal.LimitedVisionGrid + grid *testgraphs.LimitedVisionGrid w io.Writer } diff --git a/graph/path/internal/grid.go b/graph/path/internal/testgraphs/grid.go similarity index 99% rename from graph/path/internal/grid.go rename to graph/path/internal/testgraphs/grid.go index f062c049..b0d079ad 100644 --- a/graph/path/internal/grid.go +++ b/graph/path/internal/testgraphs/grid.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package internal +package testgraphs import ( "errors" diff --git a/graph/path/internal/grid_test.go b/graph/path/internal/testgraphs/grid_test.go similarity index 99% rename from graph/path/internal/grid_test.go rename to graph/path/internal/testgraphs/grid_test.go index 7132ffed..4a3fe762 100644 --- a/graph/path/internal/grid_test.go +++ b/graph/path/internal/testgraphs/grid_test.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package internal +package testgraphs import ( "bytes" diff --git a/graph/path/internal/limited.go b/graph/path/internal/testgraphs/limited.go similarity index 99% rename from graph/path/internal/limited.go rename to graph/path/internal/testgraphs/limited.go index 6e2cfcdb..347e4df4 100644 --- a/graph/path/internal/limited.go +++ b/graph/path/internal/testgraphs/limited.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package internal +package testgraphs import ( "errors" diff --git a/graph/path/internal/limited_test.go b/graph/path/internal/testgraphs/limited_test.go similarity index 99% rename from graph/path/internal/limited_test.go rename to graph/path/internal/testgraphs/limited_test.go index 6372471d..0489f5e5 100644 --- a/graph/path/internal/limited_test.go +++ b/graph/path/internal/testgraphs/limited_test.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package internal +package testgraphs import ( "math"