Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Simonstrator
PeerfactSim.KOM
Commits
d2382d56
Commit
d2382d56
authored
Dec 06, 2016
by
Nils Richerzhagen
Browse files
Added moved in/out of segment support for individual parameter models in
fiveGTopologyView
parent
8b84112a
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/topology/views/FiveGTopologyView.java
View file @
d2382d56
...
...
@@ -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
;
}
...
...
src/de/tud/kom/p2psim/impl/topology/views/fiveg/FiveGTopologyDatabase.java
View file @
d2382d56
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment