use of org.opentripplanner.visibility.VisibilityGraph in project OpenTripPlanner by opentripplanner.
the class TestVisibilityGraph method testSquareCenteredInSquare.
public void testSquareCenteredInSquare() {
Environment environment = new Environment(Arrays.asList(poly(1, 1, 5, 1, 5, 5, 1, 5), poly(2, 3.5, 2, 4.5, 3, 4.5, 3, 3.5)));
environment.enforce_standard_form();
VisibilityGraph vg = new VisibilityGraph(environment, 0.01);
boolean[][] expected = { { true, true, true, true, true, true, false, true }, { true, true, true, false, true, false, true, true }, { true, true, true, true, false, true, true, true }, { true, false, true, true, true, true, true, false }, { true, true, false, true, true, true, false, true }, { true, false, true, true, true, true, true, false }, { false, true, true, true, false, true, true, true }, { true, true, true, false, true, false, true, true } };
for (int i = 0; i < expected.length; ++i) {
for (int j = 0; j < expected[i].length; ++j) {
assertEquals("difference at " + i + ", " + j, expected[i][j], vg.get(i, j));
}
}
}
Aggregations