Commit 281c9ee1 authored by Stefan Schuhbaeck's avatar Stefan Schuhbaeck

update Tests for SAFETY_OVERLAP_FACTOR

increase size of spwan grid in SourceController to ensure peds don't overlap
parent c2bdee25
......@@ -29,7 +29,7 @@ public abstract class SourceController {
// Pedestrians should not touch each other in the spawn position.
// Therefore increase the spwan grid by 0.1.
private final double SAFETY_OVERLAP_FACTOR = 1.1;
public static final double SAFETY_OVERLAP_FACTOR = 1;
protected final Source source;
private final DynamicElementFactory dynamicElementFactory;
......
......@@ -144,7 +144,7 @@ public class GroupSourceControllerTest extends TestSourceControllerUsingConstant
@Test
public void testUpdateUseFreeSpaceOnly() {
double d = new AttributesAgent().getRadius() * 2;
double d = new AttributesAgent().getRadius() * 2 * SourceController.SAFETY_OVERLAP_FACTOR;
SourceTestAttributesBuilder builder = new SourceTestAttributesBuilder()
.setOneTimeSpawn(0)
.setSpawnNumber(100)
......@@ -233,9 +233,10 @@ public class GroupSourceControllerTest extends TestSourceControllerUsingConstant
@Test(expected = RuntimeException.class)
public void testSpawnNumber() {
double d = new AttributesAgent().getRadius() * 2 * SourceController.SAFETY_OVERLAP_FACTOR;
SourceTestAttributesBuilder builder = new SourceTestAttributesBuilder()
.setSpawnNumber(10)
.setSourceDim(5.0, 5.0)
.setSourceDim(12 * d, 12 * d ) // create source with 12x12 spots
.setGroupSizeDistribution(0.0, 0.0, 0.0, 1); // only groups of 4
initialize(builder);
......@@ -269,7 +270,7 @@ public class GroupSourceControllerTest extends TestSourceControllerUsingConstant
@Test
public void testUseFreeSpaceOnly() {
// expected: not stop spawning before all pedestrians are created (even after end time)
double d = new AttributesAgent().getRadius() * 2;
double d = new AttributesAgent().getRadius() * 2 * SourceController.SAFETY_OVERLAP_FACTOR;
double startTime = 0;
double endTime = 1;
int spawnNumber = 100;
......
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