Commit 263438bf authored by Julian Zobel's avatar Julian Zobel
Browse files

ConfigDynamicAttractionGenerator for fixeds and temporal APs

parent 568a9508
......@@ -20,7 +20,6 @@
package de.tud.kom.p2psim.impl.topology.movement.modularosm.attraction;
import java.util.LinkedList;
import de.tudarmstadt.maki.simonstrator.api.Event;
import de.tudarmstadt.maki.simonstrator.api.EventHandler;
......@@ -33,17 +32,26 @@ import de.tudarmstadt.maki.simonstrator.api.EventHandler;
*/
public class ConfigDynamicAttractionGenerator extends AbstractAttractionProvider {
private LinkedList<TemporalAttractionPoint> allAPs = new LinkedList<>();
//private LinkedList<TemporalAttractionPoint> temporalAttractionPoints = new LinkedList<>();
public void setAttractionPoint(TemporalAttractionPoint ap) {
allAPs.add(ap);
public void setAttractionPoint(AttractionPoint ap) {
addAttractionPoint(ap);
}
public void setTemporalAttractionPoint(TemporalAttractionPoint ap) {
//temporalAttractionPoints.add(ap);
if(ap.getPlacementTime() == 0) {
placeAP(ap);
}
else {
Event.scheduleWithDelay(ap.getPlacementTime(), new EventHandler() {
@Override
public void eventOccurred(Object content, int type) {
placeAP(ap);
}
}, null, 0);
}
Event.scheduleWithDelay(ap.getPlacementTime(), new EventHandler() {
@Override
public void eventOccurred(Object content, int type) {
placeAP(ap);
}
}, null, 0);
}
void placeAP(TemporalAttractionPoint ap) {
......
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