fix stationary model
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user