diff --git a/scripts/birbnetes/run_scenarios.sh b/scripts/birbnetes/run_scenarios.sh index c770335..707277d 100644 --- a/scripts/birbnetes/run_scenarios.sh +++ b/scripts/birbnetes/run_scenarios.sh @@ -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 diff --git a/src/edu/boun/edgecloudsim/mobility/StationaryMobility.java b/src/edu/boun/edgecloudsim/mobility/StationaryMobility.java index d705424..bbdf211 100644 --- a/src/edu/boun/edgecloudsim/mobility/StationaryMobility.java +++ b/src/edu/boun/edgecloudsim/mobility/StationaryMobility.java @@ -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 treeMap = treeMapArray.get(deviceId); - Map.Entry e = treeMap.floorEntry(0.0); + Map.Entry e = treeMap.floorEntry(time); if(e == null){ SimLogger.printLine("impossible is occurred! no location is found for the device '" + deviceId + "' at " + time);