Starting from 2021-07-01, all LRZ GitLab users will be required to explicitly accept the GitLab Terms of Service. Please see the detailed information at https://doku.lrz.de/display/PUBLIC/GitLab and make sure that your projects conform to the requirements.

Commit ac7563f3 authored by Benedikt Zoennchen's avatar Benedikt Zoennchen
Browse files

shape dependent grid for spawn algorithm.

parent eda455bd
Pipeline #69974 failed with stages
in 48 seconds
......@@ -52,8 +52,11 @@ public abstract class SourceController {
this.dynamicElementFactory = dynamicElementFactory;
this.topography = scenario;
this.random = random;
VRectangle elementBound = new VRectangle(dynamicElementFactory.getDynamicElementRequiredPlace(new VPoint(0,0)).getBounds2D());
this.spawnArray = new SpawnArray(new VRectangle(source.getShape().getBounds2D()),
new VRectangle(0, 0, (getDynamicElementShape().getRadius()) * 2 + SPAWN_BUFFER_SIZE, (getDynamicElementShape().getRadius()) * 2 + SPAWN_BUFFER_SIZE));
new VRectangle(0, 0,elementBound.getWidth() + SPAWN_BUFFER_SIZE, elementBound.getHeight() + SPAWN_BUFFER_SIZE));
timeOfNextEvent = sourceAttributes.getStartTime();
try {
......@@ -103,14 +106,7 @@ public abstract class SourceController {
return maxNumber != AttributesSource.NO_MAX_SPAWN_NUMBER_TOTAL
&& dynamicElementsCreatedTotal >= maxNumber;
}
private VCircle getDynamicElementShape() {
if (attributesDynamicElement instanceof AttributesAgent) {
return new VCircle(((AttributesAgent) attributesDynamicElement).getRadius());
}
return new VCircle(0.2);
}
abstract protected boolean isQueueEmpty();
abstract protected void determineNumberOfSpawnsAndNextEvent(double simTimeInSec);
......
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