Commit 89893174 authored by mey's avatar mey
Browse files

renamed BooleanGrid to BooleanGrid2D

    updated AbstractGridFilteringOp, AbstractDynamicMapTest, ConvolveOpTest.java
    updated test
parent 6a68ddb6
package de.zmt.pathfinding.filter;
import de.zmt.pathfinding.EdgeHandler;
import sim.field.grid.BooleanGrid;
import sim.field.grid.BooleanGrid2D;
import sim.field.grid.DoubleGrid2D;
/**
......@@ -73,7 +73,7 @@ abstract class AbstractGridFilteringOp implements GridFilteringOp {
* to be included in the filtering operation
* @return the resulting grid {@code dest}
*/
public DoubleGrid2D filter(DoubleGrid2D src, BooleanGrid selection) {
public DoubleGrid2D filter(DoubleGrid2D src, BooleanGrid2D selection) {
return filter(src, null, selection);
}
......@@ -91,7 +91,7 @@ abstract class AbstractGridFilteringOp implements GridFilteringOp {
* to be included in the filtering operation
* @return the resulting grid {@code dest}
*/
public DoubleGrid2D filter(DoubleGrid2D src, DoubleGrid2D dest, BooleanGrid selection) {
public DoubleGrid2D filter(DoubleGrid2D src, DoubleGrid2D dest, BooleanGrid2D selection) {
if (src == dest) {
throw new IllegalArgumentException("Source and destination grids must be different objects.");
}
......
......@@ -5,7 +5,7 @@ import static org.junit.Assert.*;
import org.junit.Test;
import sim.field.grid.BooleanGrid;
import sim.field.grid.BooleanGrid2D;
public class AbstractDynamicMapTest {
private static final int MAP_SIZE = 3;
......@@ -62,11 +62,11 @@ public class AbstractDynamicMapTest {
private static class TestDynamicMap extends AbstractDynamicMap {
private static final long serialVersionUID = 1L;
final BooleanGrid updated;
final BooleanGrid2D updated;
public TestDynamicMap(int width, int height, int xExtend, int yExtend) {
super(width, height, xExtend, yExtend);
this.updated = new BooleanGrid(width, height);
this.updated = new BooleanGrid2D(width, height);
}
@Override
......
......@@ -7,7 +7,7 @@ import static org.junit.Assert.assertThat;
import org.junit.Test;
import de.zmt.pathfinding.EdgeHandler;
import sim.field.grid.BooleanGrid;
import sim.field.grid.BooleanGrid2D;
import sim.field.grid.DoubleGrid2D;
public class ConvolveOpTest {
......@@ -91,7 +91,7 @@ public class ConvolveOpTest {
@Test
public void filterBoxWithIncludes() {
assertThat(new ConvolveOp(KERNEL_BOX).filter(ISLAND_GRID, null, new BooleanGrid(INCLUDES_ISLAND_GRID)).field,
assertThat(new ConvolveOp(KERNEL_BOX).filter(ISLAND_GRID, null, new BooleanGrid2D(INCLUDES_ISLAND_GRID)).field,
is(equalTo(RESULT_WITH_INCLUDES_BOX)));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment