Amazing technological breakthrough possible @S-Logix

Office Address

  • #5, First Floor, 4th Street Dr. Subbarayan Nagar Kodambakkam, Chennai-600 024 Landmark : Samiyar Madam
  • +91- 81240 01111

Social List

How to change mobility model in EdgeCloudSim


Nomadic mobility model is used as default, you can create your own mobility model by extending “”file
1.Create a java class as “”
2.Extend “”class.
3.Add a constructor to “” class.
4.Implement initialize() method and write to calculate location of the devices according to your own mobility model.
5.Implement another method getLocation() to return location of a device at a certain time.

Sample Code1

package edu.boun.edgecloudsim.mobility;

import edu.boun.edgecloudsim.utils.Location;
import java.util.List;
import java.util.TreeMap;

public class NewMobilityModel extends MobilityModel {

private List<TreeMap<Double, Location>> treeMapArray;

public NewMobilityModel(int numberOfMobileDevices, double simulationTime) {

super(numberOfMobileDevices, simulationTime);


public void initialize()

// own coding to locate mobility device

/* 1. create random number generator for each place
2.initialize tree maps and position of mobile devices
3.start locating user shortly after the simulation started.

public Location getLocation(int deviceId, double time) {

return locationValue;


Sample Code2

6.Add an object of our own mobility model into getMobilityModel() method of“”interface

package edu.boun.edgecloudsim.applications.sample_app1;

import ……..;
import ……..;

public class SampleScenarioFactory implements ScenarioFactory {

private int numOfMobileDevice;
private double simulationTime;


. . . . . . . .

public MobilityModel getMobilityModel()
return new NewMobilityModel(numOfMobileDevice, simulationTime);
. . . . . . . .