fix stationary model
This commit is contained in:
parent
052d4b16ce
commit
0f0b0e59e1
@ -18,6 +18,8 @@ if ! [[ $2 =~ $re ]] ; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
chmod +x runner.sh
|
||||||
|
|
||||||
script_root_path="$(dirname "$(readlink -f "$0")")"
|
script_root_path="$(dirname "$(readlink -f "$0")")"
|
||||||
root_out_folder=${script_root_path}/output
|
root_out_folder=${script_root_path}/output
|
||||||
num_of_processes=$1
|
num_of_processes=$1
|
||||||
|
@ -70,7 +70,7 @@ public class StationaryMobility extends MobilityModel {
|
|||||||
|
|
||||||
while(placeFound == false){
|
while(placeFound == false){
|
||||||
int newDatacenterId = SimUtils.getRandomNumber(0, SimSettings.getInstance().getNumOfEdgeDatacenters()-1);
|
int newDatacenterId = SimUtils.getRandomNumber(0, SimSettings.getInstance().getNumOfEdgeDatacenters()-1);
|
||||||
if(newDatacenterId != currentLocationId){
|
if(newDatacenterId == currentLocationId){
|
||||||
placeFound = true;
|
placeFound = true;
|
||||||
Node datacenterNode = datacenterList.item(newDatacenterId);
|
Node datacenterNode = datacenterList.item(newDatacenterId);
|
||||||
Element datacenterElement = (Element) datacenterNode;
|
Element datacenterElement = (Element) datacenterNode;
|
||||||
@ -97,7 +97,7 @@ public class StationaryMobility extends MobilityModel {
|
|||||||
public Location getLocation(int deviceId, double time) {
|
public Location getLocation(int deviceId, double time) {
|
||||||
TreeMap<Double, Location> treeMap = treeMapArray.get(deviceId);
|
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){
|
if(e == null){
|
||||||
SimLogger.printLine("impossible is occurred! no location is found for the device '" + deviceId + "' at " + time);
|
SimLogger.printLine("impossible is occurred! no location is found for the device '" + deviceId + "' at " + time);
|
||||||
|
Loading…
Reference in New Issue
Block a user