#5, First Floor, 4th Street , Dr. Subbarayan Nagar, Kodambakkam, Chennai-600 024 pro@slogix.in

Office Address

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

Social List

How to create Fog nodes with heterogeneous configurations

Description

To create heterogeneous fog nodes, each fog nodes contains the name, level, mips, ram, uplinkbandwidth, downlinkbandwidth and rateperMips.

Source Code

static List fogDevices = new ArrayList();

static List sensors = new ArrayList();

static List actuators = new ArrayList();

static int numOfAreas = 1;

static int numOfCamerasPerArea = 4;

private static void createFogDevices(int userId, String appId) {

FogDevice cloud = createFogDevice("cloud", 44800, 40000, 100, 10000, 0, 0.01, 16*103, 16*83.25);

cloud.setParentId(-1);

fogDevices.add(cloud);

FogDevice proxy = createFogDevice("proxy-server", 2800, 4000, 10000, 10000, 1, 0.0, 107.339, 83.4333);

proxy.setParentId(cloud.getId());

proxy.setUplinkLatency(100);

fogDevices.add(proxy);

for(int i=0;i

addArea(i+"", userId, appId, proxy.getId());

}

}

private static FogDevice addArea(String id, int userId, String appId, int parentId){

FogDevice router = createFogDevice("d-"+id, 2800, 4000, 10000, 10000, 1, 0.0, 107.339, 83.4333);

fogDevices.add(router);

router.setUplinkLatency(2); // latency of connection between router and proxy server is 2 ms

for(int i=0;i

String mobileId = id+"-"+i;

FogDevice camera = addCamera(mobileId, userId, appId, router.getId());

camera.setUplinkLatency(2);

fogDevices.add(camera);

}

router.setParentId(parentId);

return router;

}

private static FogDevice addCamera(String id, int userId, String appId, int parentId){

FogDevice camera = createFogDevice("m-"+id, 500, 1000, 10000, 10000, 3, 0, 87.53, 82.44);

camera.setParentId(parentId);

Sensor sensor = new Sensor("s-"+id, "CAMERA", userId, appId, new DeterministicDistribution(5)); // inter-transmission time of camera (sensor) follows a deterministic distribution

sensors.add(sensor);

Actuator ptz = new Actuator("ptz-"+id, userId, appId, "PTZ_CONTROL");

actuators.add(ptz);

sensor.setGatewayDeviceId(camera.getId());

sensor.setLatency(1.0); // latency of connection between camera (sensor) and the parent Smart Camera is 1 ms

ptz.setGatewayDeviceId(camera.getId());

ptz.setLatency(1.0); // latency of connection between PTZ Control and the parent Smart Camera is 1 ms

return camera;

}


Output