The name of the initial branch for new projects is now "main" instead of "master". Existing projects remain unchanged. More information: https://doku.lrz.de/display/PUBLIC/GitLab

Commit a733de64 authored by Stefan Schuhbaeck's avatar Stefan Schuhbaeck
Browse files

refactor SourceTests

parent 3a6093c1
......@@ -6,7 +6,7 @@ import org.vadere.state.attributes.scenario.AttributesDynamicElement;
import org.vadere.state.scenario.Obstacle;
import org.vadere.state.scenario.Source;
import org.vadere.state.scenario.Topography;
import org.vadere.state.util.SingleSourceSpawnArray;
import org.vadere.state.util.SpawnArray;
import org.vadere.util.geometry.PointPositioned;
import org.vadere.util.geometry.shapes.VPoint;
import org.vadere.util.geometry.shapes.VRectangle;
......@@ -27,14 +27,14 @@ public class SingleSourceController extends SourceController {
private static final int NUMBER_OF_REPOSITION_TRIES = 10;
private static final int NUMBER_OF_POINT_SEARCH = 1_000; // todo based on shape and position of source
private SingleSourceSpawnArray spawnArray;
private SpawnArray spawnArray;
public SingleSourceController(Topography scenario, Source source,
DynamicElementFactory dynamicElementFactory,
AttributesDynamicElement attributesDynamicElement,
Random random) {
super(scenario, source, dynamicElementFactory, attributesDynamicElement, random);
VRectangle elementBound = new VRectangle(dynamicElementFactory.getDynamicElementRequiredPlace(new VPoint(0,0)).getBounds2D());
this.spawnArray = new SingleSourceSpawnArray(source.getShape(),
this.spawnArray = new SpawnArray(source.getShape(),
new VRectangle(0, 0,elementBound.getWidth(), elementBound.getHeight()),
dynamicElementFactory::getDynamicElementRequiredPlace);
}
......
package org.vadere.state.util;
import com.oracle.jrockit.jfr.Producer;
import org.jetbrains.annotations.NotNull;
import org.vadere.state.scenario.DynamicElement;
import org.vadere.util.geometry.shapes.VPoint;
import org.vadere.util.geometry.shapes.VRectangle;
import org.vadere.util.geometry.shapes.VShape;
......@@ -15,11 +12,7 @@ import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import java.util.Random;
import java.util.function.BiFunction;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
/**
* <h1>Groups</h1>
......@@ -54,7 +47,7 @@ import java.util.stream.IntStream;
* same as above but it will use a Randomize groupNumber Iterator.
*
*/
public class GroupSpawnArray extends AbstractSpawnArray {
public class GroupSpawnArray extends SpawnArray {
// not an index put a way to calculate the index 1..n where n is the number of possible ways to place a given group
// key: groupSize
......
package org.vadere.state.util;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.util.geometry.shapes.VPoint;
import org.vadere.util.geometry.shapes.VRectangle;
import org.vadere.util.geometry.shapes.VShape;
import java.util.List;
import java.util.function.Function;
/**
* <h1>Single Pedestrians</h1>
*
* The single spawn algorithm divides the source in a grid based on the width of the pedestrians.
* This grid is used to place newly spawn pedestrians. These points are called allowedSpawnPoints and
* are saved as an 1D-array. Based on the Source Attribute values one of the four functions will
* be used to select the next allowedSpawnPoints.
*
* use the next free spawn point in order (0..n) to place the next pedestrian. This function will
* try to place up to maxPoints pedestrian an will wrap around to spawnPoint 0 if needed. Also this
* function will allow overlapping pedestrians a complete overlap is not allowed due to numerical
* problems in OE-solvers.
*/
public class SingleSourceSpawnArray extends AbstractSpawnArray{
private static Logger logger = LogManager.getLogger(SingleSourceSpawnArray.class);
public static final double D = 0.01;
public SingleSourceSpawnArray(final VShape boundShape, final VRectangle spawnElementBound, Function<VPoint, VShape> shapeProducer) {
super(boundShape, spawnElementBound, shapeProducer);
}
}
......@@ -11,8 +11,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.function.Function;
public abstract class AbstractSpawnArray {
private static Logger logger = LogManager.getLogger(AbstractSpawnArray.class);
public class SpawnArray {
private static Logger logger = LogManager.getLogger(SpawnArray.class);
protected final VRectangle spawnElementBound;
protected final VRectangle bound;
......@@ -28,8 +28,8 @@ public abstract class AbstractSpawnArray {
protected HashMap<Integer,Integer> validSpawnPointMapInBoundShape;
protected Function<VPoint, VShape> shapeProducer;
public AbstractSpawnArray(final VShape boundShape, final VRectangle spawnElementBound,
Function<VPoint, VShape> shapeProducer) {
public SpawnArray(final VShape boundShape, final VRectangle spawnElementBound,
Function<VPoint, VShape> shapeProducer) {
this.spawnElementBound = spawnElementBound;
this.bound = new VRectangle(boundShape.getBounds2D());
this.shapeProducer = shapeProducer;
......
package org.vadere.state.util;
import org.apache.log4j.AppenderSkeleton;
import org.apache.log4j.spi.LoggingEvent;
import org.junit.Test;
import org.vadere.state.attributes.scenario.AttributesAgent;
import org.vadere.util.geometry.shapes.VCircle;
import org.vadere.util.geometry.shapes.VPoint;
import org.vadere.util.geometry.shapes.VRectangle;
import org.vadere.util.geometry.shapes.VShape;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import static org.junit.Assert.assertEquals;
public class GroupSpawnArrayTest {
private VRectangle source;
private VRectangle elementBound;
private GroupSpawnArray spawnArray;
private AttributesAgent attr = new AttributesAgent();
private VShape shapeProducer(VPoint vPoint){
return new VCircle(vPoint, attr.getRadius());
}
VPoint[] spawnPointsAsArray(SpawnArray spawnArray){
int len = spawnArray.getAllowedSpawnPoints().size();
return spawnArray.getAllowedSpawnPoints().toArray(new VPoint[len]);
}
@Test
public void testGroupSpawnMatchDims() {
source = new VRectangle(1.0, 1.0, 8.0, 8.0);
elementBound = new VRectangle(0.0, 0.0, 1.0, 1.0);
spawnArray = new GroupSpawnArray(source, elementBound, this::shapeProducer);
assertEquals("Number of spawn points does not match", 64, spawnArray.getAllowedSpawnPoints().size());
VPoint[] spawnPoint = spawnPointsAsArray(spawnArray);
List<VShape> dynamicElements = createMock();
//group 0
LinkedList<VPoint> group = spawnArray.getNextGroup(4, dynamicElements);
assertEquals( spawnPoint[0], group.pollFirst());
assertEquals( spawnPoint[1], group.pollFirst());
assertEquals( spawnPoint[8], group.pollFirst());
assertEquals( spawnPoint[9], group.pollFirst());
//group 1
group = spawnArray.getNextGroup(4, dynamicElements);
assertEquals( spawnPoint[1], group.pollFirst());
assertEquals( spawnPoint[2], group.pollFirst());
assertEquals( spawnPoint[9], group.pollFirst());
assertEquals( spawnPoint[10], group.pollFirst());
//group 2-3
spawnArray.getNextGroup(4 , dynamicElements);
group = spawnArray.getNextGroup(4, dynamicElements);
assertEquals( spawnPoint[3], group.pollFirst());
assertEquals( spawnPoint[4], group.pollFirst());
assertEquals( spawnPoint[11], group.pollFirst());
assertEquals( spawnPoint[12], group.pollFirst());
//group 8 (line wrap)
IntStream.range(4, 7).forEach(i -> spawnArray.getNextGroup(4,dynamicElements));
group = spawnArray.getNextGroup(4, dynamicElements);
assertEquals( spawnPoint[8], group.pollFirst());
assertEquals( spawnPoint[9], group.pollFirst());
assertEquals( spawnPoint[16], group.pollFirst());
assertEquals( spawnPoint[17], group.pollFirst());
//group 48 (last group)
IntStream.range(8, 48).forEach(i -> spawnArray.getNextGroup(4, dynamicElements));
group = spawnArray.getNextGroup(4, dynamicElements);
assertEquals( spawnPoint[54], group.pollFirst());
assertEquals( spawnPoint[55], group.pollFirst());
assertEquals( spawnPoint[62], group.pollFirst());
assertEquals( spawnPoint[63], group.pollFirst());
// group 0 (wrap around to first group)
group = spawnArray.getNextGroup(4, dynamicElements);
assertEquals( spawnPoint[0], group.pollFirst());
assertEquals( spawnPoint[1], group.pollFirst());
assertEquals( spawnPoint[8], group.pollFirst());
assertEquals( spawnPoint[9], group.pollFirst());
}
@Test
public void testGroupSpawnNoMatchDims() {
source = new VRectangle(1.0, 1.0, 8.0, 8.0);
elementBound = new VRectangle(0.0, 0.0, 1.0, 1.0);
spawnArray = new GroupSpawnArray(source, elementBound, this::shapeProducer);
assertEquals("Number of spawn points does not match", 64, spawnArray.getAllowedSpawnPoints().size());
VPoint[] spawnPoints = spawnPointsAsArray(spawnArray);
List<VShape> dynamicElements = createMock();
//group 0
LinkedList<VPoint> group = spawnArray.getNextGroup(6, dynamicElements);
assertEquals(spawnPoints[0], group.pollFirst());
assertEquals(spawnPoints[1], group.pollFirst());
assertEquals(spawnPoints[2], group.pollFirst());
assertEquals(spawnPoints[8], group.pollFirst());
assertEquals(spawnPoints[9], group.pollFirst());
assertEquals(spawnPoints[10], group.pollFirst());
//group 1
group = spawnArray.getNextGroup(6, dynamicElements);
assertEquals(spawnPoints[1], group.pollFirst());
assertEquals(spawnPoints[2], group.pollFirst());
assertEquals(spawnPoints[3], group.pollFirst());
assertEquals(spawnPoints[9], group.pollFirst());
assertEquals(spawnPoints[10], group.pollFirst());
assertEquals(spawnPoints[11], group.pollFirst());
//group 6 (line wrap)
IntStream.range(2, 6).forEach(i -> spawnArray.getNextGroup(6, dynamicElements));
group = spawnArray.getNextGroup(6, dynamicElements);
assertEquals(spawnPoints[8], group.pollFirst());
assertEquals(spawnPoints[9], group.pollFirst());
assertEquals(spawnPoints[10], group.pollFirst());
assertEquals(spawnPoints[16], group.pollFirst());
assertEquals(spawnPoints[17], group.pollFirst());
assertEquals(spawnPoints[18], group.pollFirst());
//group 41 (last group)
IntStream.range(7, 41).forEach(i -> spawnArray.getNextGroup(6, dynamicElements));
group = spawnArray.getNextGroup(6, dynamicElements);
assertEquals(spawnPoints[53], group.pollFirst());
assertEquals(spawnPoints[54], group.pollFirst());
assertEquals(spawnPoints[55], group.pollFirst());
assertEquals(spawnPoints[61], group.pollFirst());
assertEquals(spawnPoints[62], group.pollFirst());
assertEquals(spawnPoints[63], group.pollFirst());
//group 0 (wrap around to first group)
group = spawnArray.getNextGroup(6, dynamicElements);
assertEquals(spawnPoints[0], group.pollFirst());
assertEquals(spawnPoints[1], group.pollFirst());
assertEquals(spawnPoints[2], group.pollFirst());
assertEquals(spawnPoints[8], group.pollFirst());
assertEquals(spawnPoints[9], group.pollFirst());
assertEquals(spawnPoints[10], group.pollFirst());
// In this case allow Overlapping but make sure the centroid of the new group members
// do not directly overlap with each other.
List<VShape> dynamicElements2 = createMock( //todo
spawnPoints[1], // direct match (use next)
spawnPoints[2].add(new VPoint( 0.1, 0)), // match within Epsilon (use next)
spawnPoints[3].add(new VPoint(0.1, 0.1)) // match outside Epsilon (use this one)
);
group = spawnArray.getNextGroup(6, dynamicElements2);
assertEquals(spawnPoints[3], group.pollFirst());
assertEquals(spawnPoints[4], group.pollFirst());
assertEquals(spawnPoints[5], group.pollFirst());
assertEquals(spawnPoints[11], group.pollFirst());
assertEquals(spawnPoints[12], group.pollFirst());
assertEquals(spawnPoints[13], group.pollFirst());
}
@Test(expected = IndexOutOfBoundsException.class)
public void mixedGroupWithErr() {
source = new VRectangle(1.0, 1.0, 8.0, 8.0);
elementBound = new VRectangle(0.0, 0.0, 1.0, 1.0);
spawnArray = new GroupSpawnArray(source, elementBound, this::shapeProducer);
assertEquals("Number of spawn points does not match", 64, spawnArray.getAllowedSpawnPoints().size());
VPoint[] spawnPoint = spawnPointsAsArray(spawnArray);
List<VShape> dynamicElements = createMock();
//group 3 lines
LinkedList<VPoint> group = spawnArray.getNextGroup(9, dynamicElements);
assertEquals(group.pollFirst(), spawnPoint[0]);
assertEquals(group.pollFirst(), spawnPoint[1]);
assertEquals(group.pollFirst(), spawnPoint[2]);
assertEquals(group.pollFirst(), spawnPoint[8]);
assertEquals(group.pollFirst(), spawnPoint[9]);
assertEquals(group.pollFirst(), spawnPoint[10]);
assertEquals(group.pollFirst(), spawnPoint[16]);
assertEquals(group.pollFirst(), spawnPoint[17]);
assertEquals(group.pollFirst(), spawnPoint[18]);
//group 0
group = spawnArray.getNextGroup(4, dynamicElements);
assertEquals(group.pollFirst(), spawnPoint[0]);
assertEquals(group.pollFirst(), spawnPoint[1]);
assertEquals(group.pollFirst(), spawnPoint[8]);
assertEquals(group.pollFirst(), spawnPoint[9]);
// spawning different size groups does not effect other groups
spawnArray.getNextGroup(9, dynamicElements);
spawnArray.getNextGroup(9, dynamicElements);
//group 1
group = spawnArray.getNextGroup(4, dynamicElements);
assertEquals(group.pollFirst(), spawnPoint[1]);
assertEquals(group.pollFirst(), spawnPoint[2]);
assertEquals(group.pollFirst(), spawnPoint[9]);
assertEquals(group.pollFirst(), spawnPoint[10]);
spawnArray.getNextGroup(100, dynamicElements);
}
@Test
public void testFreeGroupSpawn() {
source = new VRectangle(1.0, 1.0, 8.0, 8.0);
elementBound = new VRectangle(0.0, 0.0, 1.0, 1.0);
spawnArray = new GroupSpawnArray(source, elementBound, this::shapeProducer);
assertEquals("Number of spawn points does not match", 64, spawnArray.getAllowedSpawnPoints().size());
VPoint[] spawnPoint = spawnPointsAsArray(spawnArray);
LinkedList<VPoint> group = spawnArray.getNextFreeGroup(6, createMock( new VPoint(99.0, 99.0)));
assertEquals(group.pollFirst(), spawnPoint[0]);
assertEquals(group.pollFirst(), spawnPoint[1]);
assertEquals(group.pollFirst(), spawnPoint[2]);
assertEquals(group.pollFirst(), spawnPoint[8]);
assertEquals(group.pollFirst(), spawnPoint[9]);
assertEquals(group.pollFirst(), spawnPoint[10]);
// empty neighbours
group = spawnArray.getNextFreeGroup(6, new LinkedList<>());
assertEquals(group.pollFirst(), spawnPoint[0]);
assertEquals(group.pollFirst(), spawnPoint[1]);
assertEquals(group.pollFirst(), spawnPoint[2]);
assertEquals(group.pollFirst(), spawnPoint[8]);
assertEquals(group.pollFirst(), spawnPoint[9]);
assertEquals(group.pollFirst(), spawnPoint[10]);
// match group 3 (with overlapping groups)
List<VShape> dynamicElements = createMock( spawnPoint[0], spawnPoint[1], spawnPoint[10]);
group = spawnArray.getNextFreeGroup(6, dynamicElements);
assertEquals(group.pollFirst(), spawnPoint[3]);
assertEquals(group.pollFirst(), spawnPoint[4]);
assertEquals(group.pollFirst(), spawnPoint[5]);
assertEquals(group.pollFirst(), spawnPoint[11]);
assertEquals(group.pollFirst(), spawnPoint[12]);
assertEquals(group.pollFirst(), spawnPoint[13]);
//match group 9 (with overlapping groups and line wrap)
dynamicElements = createMock(
spawnPoint[0],
spawnPoint[1],
spawnPoint[2],
spawnPoint[3],
spawnPoint[6],
spawnPoint[9]);
group = spawnArray.getNextFreeGroup(6, dynamicElements);
assertEquals(group.pollFirst(), spawnPoint[10]);
assertEquals(group.pollFirst(), spawnPoint[11]);
assertEquals(group.pollFirst(), spawnPoint[12]);
assertEquals(group.pollFirst(), spawnPoint[18]);
assertEquals(group.pollFirst(), spawnPoint[19]);
assertEquals(group.pollFirst(), spawnPoint[20]);
}
/**
* Group dimension is set as W x H for a Group of 6 this would be 3x2 Test if Source Width is
* smaller than 3! Here the Group must be 2x3
*/
@Test
public void groupXDimBiggerThanSource() {
source = new VRectangle(1.0, 1.0, 2.0, 7);
elementBound = new VRectangle(0.0, 0.0, 1.0, 1.0);
spawnArray = new GroupSpawnArray(source, elementBound, this::shapeProducer);
VPoint[] spawnPoints = spawnPointsAsArray(spawnArray);
LinkedList<VPoint> points = spawnArray.getNextGroup(6, createMock());
assertEquals(spawnPoints[0], points.pollFirst());
assertEquals(spawnPoints[1], points.pollFirst());
assertEquals(spawnPoints[2], points.pollFirst());
assertEquals(spawnPoints[3], points.pollFirst());
assertEquals(spawnPoints[4], points.pollFirst());
assertEquals(spawnPoints[5], points.pollFirst());
}
private List<VShape> createMock( List<VPoint> points) {
return points.stream().map(this::shapeProducer).collect(Collectors.toList());
}
private List<VShape> createMock( VPoint... points) {
return createMock(Arrays.asList(points));
}
class TestAppender extends AppenderSkeleton {
private final List<LoggingEvent> log = new ArrayList<LoggingEvent>();
@Override
protected void append(LoggingEvent loggingEvent) {
log.add(loggingEvent);
}
@Override
public boolean requiresLayout() {
return false;
}
@Override
public void close() {
}
public List<LoggingEvent> getLog() {
return new ArrayList<LoggingEvent>(log);
}
}
}
\ No newline at end of file
......@@ -5,35 +5,46 @@ import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.apache.log4j.spi.LoggingEvent;
import org.junit.Test;
import org.mockito.Mockito;
import org.vadere.state.attributes.scenario.AttributesAgent;
import org.vadere.state.scenario.DynamicElement;
import org.vadere.util.geometry.shapes.VCircle;
import org.vadere.util.geometry.shapes.VPoint;
import org.vadere.util.geometry.shapes.VRectangle;
import org.vadere.util.geometry.shapes.VShape;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
public class SpawnArrayTest {
private VRectangle source;
private VRectangle elementBound;
private SpawnArray spawnArray;
private AttributesAgent attr = new AttributesAgent();
private VShape shapeProducer(VPoint vPoint){
return new VCircle(vPoint, attr.getRadius());
}
VPoint[] spawnPointsAsArray(SpawnArray spawnArray){
int len = spawnArray.getAllowedSpawnPoints().size();
return spawnArray.getAllowedSpawnPoints().toArray(new VPoint[len]);
}
@Test
public void NumberOfElements() {
// Number of Elements
source = new VRectangle(1.0, 1.0, 9.9, 9.9);
elementBound = new VRectangle(0.0, 0.0, 1.0, 1.0);
spawnArray = new SpawnArray(source, elementBound);
assertEquals("expected spawn points don't match", 81, spawnArray.getSpawnPoints().length);
spawnArray = new SpawnArray(source, elementBound, this::shapeProducer);
assertEquals("expected spawn points don't match", 81, spawnArray.getAllowedSpawnPoints().size());
}
@Test
......@@ -45,8 +56,8 @@ public class SpawnArrayTest {
source = new VRectangle(1.0, 1.0, 0.1, 0.1);
elementBound = new VRectangle(0.0, 0.0, 1.0, 1.0);
spawnArray = new SpawnArray(source, elementBound);
assertEquals("expected spawn points don't match", 1, spawnArray.getSpawnPoints().length);
spawnArray = new SpawnArray(source, elementBound, this::shapeProducer);
assertEquals("expected spawn points don't match", 1, spawnArray.getAllowedSpawnPoints().size());
String msg = String.format("Dimension of Source is to small for at least one" +
" dimension to contain designated spawnElement with" +
......@@ -65,8 +76,8 @@ public class SpawnArrayTest {
source = new VRectangle(1.0, 1.0, 3.0, 0.1);
elementBound = new VRectangle(0.0, 0.0, 1.0, 1.0);
spawnArray = new SpawnArray(source, elementBound);
assertEquals("expected spawn points don't match", 3, spawnArray.getSpawnPoints().length);
spawnArray = new SpawnArray(source, elementBound, this::shapeProducer);
assertEquals("expected spawn points don't match", 3, spawnArray.getAllowedSpawnPoints().size());
String msg = String.format("Dimension of Source is to small for at least one" +
" dimension to contain designated spawnElement with" +
" Bound (%.2f x %.2f) Set to (%d x %d)",
......@@ -76,35 +87,15 @@ public class SpawnArrayTest {
log.removeAppender(testAppender);
}
/**
* Group dimension is set as W x H for a Group of 6 this would be 3x2 Test if Source Width is
* smaller than 3! Here the Group must be 2x3
*/
@Test
public void groupXDimBiggerThanSource() {
source = new VRectangle(1.0, 1.0, 2.0, 7);
elementBound = new VRectangle(0.0, 0.0, 1.0, 1.0);
spawnArray = new SpawnArray(source, elementBound);
VPoint[] spawnPoints = spawnArray.getSpawnPoints();
LinkedList<VPoint> points = spawnArray.getNextGroup(6, createMock(0.5));
assertEquals(spawnPoints[0], points.pollFirst());
assertEquals(spawnPoints[1], points.pollFirst());
assertEquals(spawnPoints[2], points.pollFirst());
assertEquals(spawnPoints[3], points.pollFirst());
assertEquals(spawnPoints[4], points.pollFirst());
assertEquals(spawnPoints[5], points.pollFirst());
}
@Test
public void Points() {
source = new VRectangle(1.0, 1.0, 9.9, 9.9);
elementBound = new VRectangle(0.0, 0.0, 1.0, 1.0);
spawnArray = new SpawnArray(source, elementBound);
spawnArray = new SpawnArray(source, elementBound, this::shapeProducer);
// first Point
List<DynamicElement> dynamicElements = createMock(0.5);
List<VShape> dynamicElements = createMock();
VPoint p = spawnArray.getNextSpawnPoints(1, dynamicElements).getFirst();
assertEquals("Point does not match", p, new VPoint(1.5, 1.5));
assertEquals("Next Element does not match", 1, spawnArray.getNextSpawnPointIndex());
......@@ -123,7 +114,7 @@ public class SpawnArrayTest {
assertEquals("Point does not match", spawnArray.getNextSpawnPoints(1, dynamicElements).getFirst(),
new VPoint(first.x + 3 * 2 * elementBound.width / 2, first.y + 1 * 2 * elementBound.height / 2));
VPoint[] spawnPoints = spawnArray.getSpawnPoints();
VPoint[] spawnPoints = spawnPointsAsArray(spawnArray);
List<DynamicElement> dynamicElements2 = createMock(0.5,
spawnPoints[12], // direct match (use next)
spawnPoints[13].add(new VPoint(0, SpawnArray.OVERLAPP_EPSILON - 0.1)), // match within Epsilon (use next)
......@@ -138,10 +129,10 @@ public class SpawnArrayTest {
public void PointsWithException(){
source = new VRectangle(1.0, 1.0, 2.0, 2.0);
elementBound = new VRectangle(0.0, 0.0, 1.0, 1.0);
spawnArray = new SpawnArray(source, elementBound);
spawnArray = new SpawnArray(source, elementBound, this::shapeProducer);
VPoint[] spawnPoints = spawnArray.getSpawnPoints();
List<DynamicElement> dynamicElements = createMock(0.5,
VPoint[] spawnPoints = spawnPointsAsArray(spawnArray);
List<VShape> dynamicElements = createMock(
spawnPoints[0],
spawnPoints[1],
spawnPoints[2],
......@@ -155,17 +146,17 @@ public class SpawnArrayTest {
public void testFreeSpawn() {
source = new VRectangle(1.0, 1.0, 2.0, 2.0);
elementBound = new VRectangle(0.0, 0.0, 1.0,