11.08., 9:00 - 11:00: Due to updates GitLab will be unavailable for some minutes between 09:00 and 11:00.

Commit 48b9fffd authored by Stefan Schuhbaeck's avatar Stefan Schuhbaeck

fix compilation error after merge

parent 35398f11
Pipeline #230122 passed with stages
in 134 minutes and 4 seconds
......@@ -17,6 +17,11 @@ public interface DynamicElementFactory {
*/
<T extends DynamicElement> DynamicElement createElement(VPoint position, int id, Class<T> type);
/**
* Override the DynamicElement Attributes given in the topography by the values given here.
* Note: The Attribute values come from the source and are set by the SourceController
* during DynamicElement Creation.
*/
<T extends DynamicElement> DynamicElement createElement(VPoint position, int id, Attributes attr, Class<T> type);
......
......@@ -6,6 +6,7 @@ import org.vadere.simulator.control.factory.SingleSourceControllerFactory;
import org.vadere.simulator.control.factory.SourceControllerFactory;
import org.vadere.simulator.control.scenarioelements.SourceController;
import org.vadere.simulator.models.DynamicElementFactory;
import org.vadere.state.attributes.Attributes;
import org.vadere.state.attributes.scenario.AttributesAgent;
import org.vadere.state.attributes.scenario.AttributesSource;
import org.vadere.state.attributes.scenario.SourceTestAttributesBuilder;
......@@ -79,6 +80,15 @@ public class TestSourceController {
return ped;
}
@Override
public <T extends DynamicElement> DynamicElement createElement(VPoint position, int id, Attributes attr, Class<T> type) {
AttributesAgent att = new AttributesAgent(
d.attributesPedestrian, registerDynamicElementId(null, id));
Pedestrian ped = new Pedestrian(att, d.random);
ped.setPosition(position);
return ped;
}
@Override
public int registerDynamicElementId(Topography topography, int id) {
return id > 0 ? id : ++pedestrianIdCounter;
......
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