Commit 7470eda8 authored by Björn Richerzhagen's avatar Björn Richerzhagen
Browse files

The 5G-view now correctly sets the AP-state without movement

parent 72ba3b6f
......@@ -35,6 +35,8 @@ import de.tud.kom.p2psim.api.topology.waypoints.WaypointModel;
import de.tud.kom.p2psim.impl.topology.PositionVector;
import de.tud.kom.p2psim.impl.topology.views.FiveGTopologyView.CellLink;
import de.tud.kom.p2psim.impl.topology.views.fiveg.FiveGTopologyDatabase;
import de.tudarmstadt.maki.simonstrator.api.Event;
import de.tudarmstadt.maki.simonstrator.api.EventHandler;
import de.tudarmstadt.maki.simonstrator.api.Host;
import de.tudarmstadt.maki.simonstrator.api.component.sensor.handover.HandoverSensor;
import de.tudarmstadt.maki.simonstrator.api.util.XMLConfigurableConstructor;
......@@ -120,6 +122,17 @@ public class FiveGTopologyView extends AbstractTopologyView<CellLink> {
public FiveGTopologyView(PhyType phy) {
super(phy, true);
setHasRealLinkLayer(false);
/*
* AP state is only set, after components moved. In scenarios without
* active movement, this will never happen. Therefore, we trigger the
* respective event ONCE at the start of the simulation
*/
Event.scheduleImmediately(new EventHandler() {
@Override
public void eventOccurred(Object content, int type) {
afterComponentsMoved();
}
}, null, 0);
}
@XMLConfigurableConstructor({ "phy" })
......@@ -220,8 +233,7 @@ public class FiveGTopologyView extends AbstractTopologyView<CellLink> {
}
@Override
protected CellLink createLink(MacAddress source,
MacAddress destination) {
protected CellLink createLink(MacAddress source, MacAddress destination) {
boolean sourceIsClient = mobileClients.contains(source);
boolean destinationIsClient = mobileClients.contains(destination);
if (sourceIsClient == destinationIsClient) {
......
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