To create heterogeneous fog nodes, each fog nodes contains the name, level, mips, ram, uplinkbandwidth, downlinkbandwidth and rateperMips.
static List
static List
static List
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; }