fix stationary model

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

View File

@ -18,6 +18,8 @@ if ! [[ $2 =~ $re ]] ; then
exit 1
fi
chmod +x runner.sh
script_root_path="$(dirname "$(readlink -f "$0")")"
root_out_folder=${script_root_path}/output
num_of_processes=$1

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);