fix stationary model

This commit is contained in:
2021-04-05 21:11:48 +02:00
parent 052d4b16ce
commit 0f0b0e59e1
2 changed files with 4 additions and 2 deletions

View File

@ -70,7 +70,7 @@ public class StationaryMobility extends MobilityModel {
while(placeFound == false){
int newDatacenterId = SimUtils.getRandomNumber(0, SimSettings.getInstance().getNumOfEdgeDatacenters()-1);
if(newDatacenterId != currentLocationId){
if(newDatacenterId == currentLocationId){
placeFound = true;
Node datacenterNode = datacenterList.item(newDatacenterId);
Element datacenterElement = (Element) datacenterNode;
@ -97,7 +97,7 @@ public class StationaryMobility extends MobilityModel {
public Location getLocation(int deviceId, double time) {
TreeMap<Double, Location> treeMap = treeMapArray.get(deviceId);
Map.Entry<Double, Location> e = treeMap.floorEntry(0.0);
Map.Entry<Double, Location> e = treeMap.floorEntry(time);
if(e == null){
SimLogger.printLine("impossible is occurred! no location is found for the device '" + deviceId + "' at " + time);