The mobile processing unit support as well as a sample application are added.
The mobile processing units are simulated via CloudSim. It is assumed that the mobile devices operate Hosts and VMs like a server. Therefore, the classes located in the mobile_processing_unit package have a similar naming convention to the other Cloud and Edge components.
This commit is contained in:
@@ -15,6 +15,7 @@ package edu.boun.edgecloudsim.core;
|
||||
|
||||
import edu.boun.edgecloudsim.cloud_server.CloudServerManager;
|
||||
import edu.boun.edgecloudsim.edge_client.MobileDeviceManager;
|
||||
import edu.boun.edgecloudsim.edge_client.mobile_processing_unit.MobileServerManager;
|
||||
import edu.boun.edgecloudsim.edge_orchestrator.EdgeOrchestrator;
|
||||
import edu.boun.edgecloudsim.edge_server.EdgeServerManager;
|
||||
import edu.boun.edgecloudsim.mobility.MobilityModel;
|
||||
@@ -52,6 +53,11 @@ public interface ScenarioFactory {
|
||||
*/
|
||||
public CloudServerManager getCloudServerManager();
|
||||
|
||||
/**
|
||||
* provides abstract Mobile Server Model
|
||||
*/
|
||||
public MobileServerManager getMobileServerManager();
|
||||
|
||||
/**
|
||||
* provides abstract Mobile Device Manager Model
|
||||
*/
|
||||
|
||||
@@ -26,6 +26,7 @@ import edu.boun.edgecloudsim.edge_server.EdgeServerManager;
|
||||
import edu.boun.edgecloudsim.edge_server.EdgeVmAllocationPolicy_Custom;
|
||||
import edu.boun.edgecloudsim.cloud_server.CloudServerManager;
|
||||
import edu.boun.edgecloudsim.edge_client.MobileDeviceManager;
|
||||
import edu.boun.edgecloudsim.edge_client.mobile_processing_unit.MobileServerManager;
|
||||
import edu.boun.edgecloudsim.mobility.MobilityModel;
|
||||
import edu.boun.edgecloudsim.task_generator.LoadGeneratorModel;
|
||||
import edu.boun.edgecloudsim.network.NetworkModel;
|
||||
@@ -48,6 +49,7 @@ public class SimManager extends SimEntity {
|
||||
private EdgeOrchestrator edgeOrchestrator;
|
||||
private EdgeServerManager edgeServerManager;
|
||||
private CloudServerManager cloudServerManager;
|
||||
private MobileServerManager mobileServerManager;
|
||||
private LoadGeneratorModel loadGeneratorModel;
|
||||
private MobileDeviceManager mobileDeviceManager;
|
||||
|
||||
@@ -85,6 +87,10 @@ public class SimManager extends SimEntity {
|
||||
//Create Physical Servers on cloud
|
||||
cloudServerManager = scenarioFactory.getCloudServerManager();
|
||||
cloudServerManager.initialize();
|
||||
|
||||
//Create Physical Servers on mobile devices
|
||||
mobileServerManager = scenarioFactory.getMobileServerManager();
|
||||
mobileServerManager.initialize();
|
||||
|
||||
//Create Client Manager
|
||||
mobileDeviceManager = scenarioFactory.getMobileDeviceManager();
|
||||
@@ -111,7 +117,11 @@ public class SimManager extends SimEntity {
|
||||
//Start Edge Datacenters & Generate VMs
|
||||
cloudServerManager.startDatacenters();
|
||||
cloudServerManager.createVmList(mobileDeviceManager.getId());
|
||||
|
||||
|
||||
//Start Mobile Datacenters & Generate VMs
|
||||
mobileServerManager.startDatacenters();
|
||||
mobileServerManager.createVmList(mobileDeviceManager.getId());
|
||||
|
||||
CloudSim.startSimulation();
|
||||
}
|
||||
|
||||
@@ -151,6 +161,10 @@ public class SimManager extends SimEntity {
|
||||
return cloudServerManager;
|
||||
}
|
||||
|
||||
public MobileServerManager getMobileServerManager(){
|
||||
return mobileServerManager;
|
||||
}
|
||||
|
||||
public LoadGeneratorModel getLoadGeneratorModel(){
|
||||
return loadGeneratorModel;
|
||||
}
|
||||
@@ -175,6 +189,11 @@ public class SimManager extends SimEntity {
|
||||
mobileDeviceManager.submitVmList(cloudServerManager.getVmList(i));
|
||||
}
|
||||
|
||||
for(int i=0; i<numOfMobileDevice; i++){
|
||||
if(mobileServerManager.getVmList(i) != null)
|
||||
mobileDeviceManager.submitVmList(mobileServerManager.getVmList(i));
|
||||
}
|
||||
|
||||
//Creation of tasks are scheduled here!
|
||||
for(int i=0; i< loadGeneratorModel.getTaskList().size(); i++)
|
||||
schedule(getId(), loadGeneratorModel.getTaskList().get(i).startTime, CREATE_TASK, loadGeneratorModel.getTaskList().get(i));
|
||||
@@ -212,7 +231,8 @@ public class SimManager extends SimEntity {
|
||||
SimLogger.getInstance().addVmUtilizationLog(
|
||||
CloudSim.clock(),
|
||||
edgeServerManager.getAvgUtilization(),
|
||||
cloudServerManager.getAvgUtilization());
|
||||
cloudServerManager.getAvgUtilization(),
|
||||
mobileServerManager.getAvgUtilization());
|
||||
|
||||
schedule(getId(), SimSettings.getInstance().getVmLoadLogInterval(), GET_LOAD_LOG);
|
||||
break;
|
||||
@@ -247,5 +267,6 @@ public class SimManager extends SimEntity {
|
||||
public void shutdownEntity() {
|
||||
edgeServerManager.terminateDatacenters();
|
||||
cloudServerManager.terminateDatacenters();
|
||||
mobileServerManager.terminateDatacenters();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,15 +36,16 @@ public class SimSettings {
|
||||
public static final double CLIENT_ACTIVITY_START_TIME = 10;
|
||||
|
||||
//enumarations for the VM types
|
||||
public static enum VM_TYPES { EDGE_VM, CLOUD_VM }
|
||||
public static enum VM_TYPES { MOBILE_VM, EDGE_VM, CLOUD_VM }
|
||||
|
||||
//enumarations for the VM types
|
||||
public static enum NETWORK_DELAY_TYPES { WLAN_DELAY, MAN_DELAY, WAN_DELAY }
|
||||
|
||||
//predifined IDs for the components.
|
||||
public static final int CLOUD_DATACENTER_ID = 1000;
|
||||
public static final int EDGE_ORCHESTRATOR_ID = 1001;
|
||||
public static final int GENERIC_EDGE_DEVICE_ID = 1002;
|
||||
public static final int MOBILE_DATACENTER_ID = 1001;
|
||||
public static final int EDGE_ORCHESTRATOR_ID = 1002;
|
||||
public static final int GENERIC_EDGE_DEVICE_ID = 1003;
|
||||
|
||||
//delimiter for output file.
|
||||
public static final String DELIMITER = ";";
|
||||
@@ -78,6 +79,11 @@ public class SimSettings {
|
||||
private int RAM_FOR_CLOUD_VM; //MB
|
||||
private int STORAGE_FOR_CLOUD_VM; //Byte
|
||||
|
||||
private int CORE_FOR_VM;
|
||||
private int MIPS_FOR_VM; //MIPS
|
||||
private int RAM_FOR_VM; //MB
|
||||
private int STORAGE_FOR_VM; //Byte
|
||||
|
||||
private String[] SIMULATION_SCENARIOS;
|
||||
private String[] ORCHESTRATOR_POLICIES;
|
||||
|
||||
@@ -152,6 +158,11 @@ public class SimSettings {
|
||||
RAM_FOR_CLOUD_VM = Integer.parseInt(prop.getProperty("ram_for_cloud_vm"));
|
||||
STORAGE_FOR_CLOUD_VM = Integer.parseInt(prop.getProperty("storage_for_cloud_vm"));
|
||||
|
||||
RAM_FOR_VM = Integer.parseInt(prop.getProperty("ram_for_mobile_vm"));
|
||||
CORE_FOR_VM = Integer.parseInt(prop.getProperty("core_for_mobile_vm"));
|
||||
MIPS_FOR_VM = Integer.parseInt(prop.getProperty("mips_for_mobile_vm"));
|
||||
STORAGE_FOR_VM = Integer.parseInt(prop.getProperty("storage_for_mobile_vm"));
|
||||
|
||||
ORCHESTRATOR_POLICIES = prop.getProperty("orchestrator_policies").split(",");
|
||||
|
||||
SIMULATION_SCENARIOS = prop.getProperty("simulation_scenarios").split(",");
|
||||
@@ -395,6 +406,38 @@ public class SimSettings {
|
||||
{
|
||||
return STORAGE_FOR_CLOUD_VM;
|
||||
}
|
||||
|
||||
/**
|
||||
* returns RAM of the mobile (processing unit) VMs
|
||||
*/
|
||||
public int getRamForMobileVM()
|
||||
{
|
||||
return RAM_FOR_VM;
|
||||
}
|
||||
|
||||
/**
|
||||
* returns the number of cores for mobile VMs
|
||||
*/
|
||||
public int getCoreForMobileVM()
|
||||
{
|
||||
return CORE_FOR_VM;
|
||||
}
|
||||
|
||||
/**
|
||||
* returns MIPS of the mobile (processing unit) VMs
|
||||
*/
|
||||
public int getMipsForMobileVM()
|
||||
{
|
||||
return MIPS_FOR_VM;
|
||||
}
|
||||
|
||||
/**
|
||||
* returns Storage of the mobile (processing unit) VMs
|
||||
*/
|
||||
public int getStorageForMobileVM()
|
||||
{
|
||||
return STORAGE_FOR_VM;
|
||||
}
|
||||
|
||||
/**
|
||||
* returns simulation screnarios as string
|
||||
@@ -433,8 +476,9 @@ public class SimSettings {
|
||||
* [6] avg data download (KB)
|
||||
* [7] avg task length (MI)
|
||||
* [8] required # of cores
|
||||
* [9] vm utilization on edge (%)
|
||||
* [10] vm utilization on cloud (%)
|
||||
* [9] vm utilization on edge (%)
|
||||
* [10] vm utilization on cloud (%)
|
||||
* [11] vm utilization on mobile (%)
|
||||
*/
|
||||
public double[][] getTaskLookUpTable()
|
||||
{
|
||||
@@ -493,6 +537,7 @@ public class SimSettings {
|
||||
isElementPresent(appElement, "required_core");
|
||||
isElementPresent(appElement, "vm_utilization_on_edge");
|
||||
isElementPresent(appElement, "vm_utilization_on_cloud");
|
||||
isElementPresent(appElement, "vm_utilization_on_mobile");
|
||||
|
||||
String taskName = appElement.getAttribute("name");
|
||||
taskNames[i] = taskName;
|
||||
@@ -508,7 +553,8 @@ public class SimSettings {
|
||||
double required_core = Double.parseDouble(appElement.getElementsByTagName("required_core").item(0).getTextContent());
|
||||
double vm_utilization_on_edge = Double.parseDouble(appElement.getElementsByTagName("vm_utilization_on_edge").item(0).getTextContent());
|
||||
double vm_utilization_on_cloud = Double.parseDouble(appElement.getElementsByTagName("vm_utilization_on_cloud").item(0).getTextContent());
|
||||
|
||||
double vm_utilization_on_mobile = Double.parseDouble(appElement.getElementsByTagName("vm_utilization_on_mobile").item(0).getTextContent());
|
||||
|
||||
taskLookUpTable[i][0] = usage_percentage; //usage percentage [0-100]
|
||||
taskLookUpTable[i][1] = prob_cloud_selection; //prob. of selecting cloud [0-100]
|
||||
taskLookUpTable[i][2] = poisson_interarrival; //poisson mean (sec)
|
||||
@@ -520,6 +566,7 @@ public class SimSettings {
|
||||
taskLookUpTable[i][8] = required_core; //required # of core
|
||||
taskLookUpTable[i][9] = vm_utilization_on_edge; //vm utilization on edge vm [0-100]
|
||||
taskLookUpTable[i][10] = vm_utilization_on_cloud; //vm utilization on cloud vm [0-100]
|
||||
taskLookUpTable[i][11] = vm_utilization_on_mobile; //vm utilization on mobile vm [0-100]
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
@@ -595,4 +642,4 @@ public class SimSettings {
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user