Commit d2382d56 authored by Nils Richerzhagen's avatar Nils Richerzhagen
Browse files

Added moved in/out of segment support for individual parameter models in

fiveGTopologyView
parent 8b84112a
......@@ -213,12 +213,12 @@ public class FiveGTopologyView extends AbstractTopologyView<CellLink> {
null);
}
}
/**
* Check, if a node moved into a new segment. If so, we need to update
* the HandoverSensor to trigger the listeners. We only need to check
* nodes that are included in the list of ap-enabled nodes (i.e., they
* already have a HandoverSensor-instance).
* Check, if a node moved into a new segment. If so, we need to update the
* HandoverSensor to trigger the listeners. We only need to check nodes that
* are included in the list of ap-enabled nodes (i.e., they already have a
* HandoverSensor-instance).
*/
protected void checkAPAssociations() {
for (HandoverSensor5G sensor : handoverSensors) {
......@@ -232,7 +232,7 @@ public class FiveGTopologyView extends AbstractTopologyView<CellLink> {
databaseAccessPoints.getEntryFor(segId, false) != null);
}
}
/*
* FIXME the not-so-elegant approach of updating all max-BWs
*/
......@@ -240,9 +240,9 @@ public class FiveGTopologyView extends AbstractTopologyView<CellLink> {
updateMaxMacBandwidth(mobileClient);
}
}
long lastMovementTimestamp = 0;
@Override
public void onLocationChanged(Host host, Location location) {
super.onLocationChanged(host, location);
......@@ -442,6 +442,30 @@ public class FiveGTopologyView extends AbstractTopologyView<CellLink> {
public void setLinkData(FiveGTopologyDatabase.Entry linkData,
FiveGTopologyDatabase.Entry apLinkData) {
if (apLinkData != null) {
assert supportsAccessPoints;
if (this.apLinkData != null) {
// was in AP, moves into AP
this.apLinkData.onHostLeavesSegment(mobileClient);
apLinkData.onHostEntersSegment(mobileClient);
} else {
// was NOT in AP, moves into AP
this.linkData.onHostLeavesSegment(mobileClient);
apLinkData.onHostEntersSegment(mobileClient);
}
} else {
if (this.apLinkData != null) {
// was in AP, moves OUT OF AP
this.apLinkData.onHostLeavesSegment(mobileClient);
linkData.onHostEntersSegment(mobileClient);
} else {
// was NOT in AP, moves into NON-AP segment
this.linkData.onHostLeavesSegment(mobileClient);
linkData.onHostEntersSegment(mobileClient);
}
}
this.linkData = linkData;
assert (apLinkData != null && supportsAccessPoints)
|| apLinkData == null;
......@@ -485,10 +509,11 @@ public class FiveGTopologyView extends AbstractTopologyView<CellLink> {
}
@Override
public boolean isConnected()
{
if(apLinkData != null) return apLinkData.getConnectivity();
if(linkData != null) return linkData.getConnectivity();
public boolean isConnected() {
if (apLinkData != null)
return apLinkData.getConnectivity();
if (linkData != null)
return linkData.getConnectivity();
return false;
}
......
......@@ -20,6 +20,7 @@
package de.tud.kom.p2psim.impl.topology.views.fiveg;
import de.tud.kom.p2psim.api.linklayer.mac.MacAddress;
import de.tud.kom.p2psim.impl.topology.views.FiveGTopologyView;
import de.tud.kom.p2psim.impl.topology.views.FiveGTopologyView.CellLink;
......@@ -93,6 +94,14 @@ public interface FiveGTopologyDatabase {
* @return
*/
public int getSegmentID();
default public void onHostLeavesSegment(MacAddress hostAddr) {
// ignore
}
default public void onHostEntersSegment(MacAddress hostAddr) {
// ignore
}
/**
* Probability of a packet drop on the link - can even be 1, so that the
......
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