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.
87 lines
2.9 KiB
Java
87 lines
2.9 KiB
Java
/*
|
|
* Title: EdgeCloudSim - Scenario Factory
|
|
*
|
|
* Description: Sample scenario factory providing the default
|
|
* instances of required abstract classes
|
|
*
|
|
* Licence: GPL - http://www.gnu.org/copyleft/gpl.html
|
|
* Copyright (c) 2017, Bogazici University, Istanbul, Turkey
|
|
*/
|
|
|
|
package edu.boun.edgecloudsim.applications.sample_app1;
|
|
|
|
import edu.boun.edgecloudsim.cloud_server.CloudServerManager;
|
|
import edu.boun.edgecloudsim.cloud_server.DefaultCloudServerManager;
|
|
import edu.boun.edgecloudsim.core.ScenarioFactory;
|
|
import edu.boun.edgecloudsim.edge_orchestrator.BasicEdgeOrchestrator;
|
|
import edu.boun.edgecloudsim.edge_orchestrator.EdgeOrchestrator;
|
|
import edu.boun.edgecloudsim.edge_server.DefaultEdgeServerManager;
|
|
import edu.boun.edgecloudsim.edge_server.EdgeServerManager;
|
|
import edu.boun.edgecloudsim.edge_client.DefaultMobileDeviceManager;
|
|
import edu.boun.edgecloudsim.edge_client.MobileDeviceManager;
|
|
import edu.boun.edgecloudsim.edge_client.mobile_processing_unit.DefaultMobileServerManager;
|
|
import edu.boun.edgecloudsim.edge_client.mobile_processing_unit.MobileServerManager;
|
|
import edu.boun.edgecloudsim.mobility.MobilityModel;
|
|
import edu.boun.edgecloudsim.mobility.NomadicMobility;
|
|
import edu.boun.edgecloudsim.task_generator.IdleActiveLoadGenerator;
|
|
import edu.boun.edgecloudsim.task_generator.LoadGeneratorModel;
|
|
import edu.boun.edgecloudsim.network.MM1Queue;
|
|
import edu.boun.edgecloudsim.network.NetworkModel;
|
|
|
|
public class SampleScenarioFactory implements ScenarioFactory {
|
|
private int numOfMobileDevice;
|
|
private double simulationTime;
|
|
private String orchestratorPolicy;
|
|
private String simScenario;
|
|
|
|
SampleScenarioFactory(int _numOfMobileDevice,
|
|
double _simulationTime,
|
|
String _orchestratorPolicy,
|
|
String _simScenario){
|
|
orchestratorPolicy = _orchestratorPolicy;
|
|
numOfMobileDevice = _numOfMobileDevice;
|
|
simulationTime = _simulationTime;
|
|
simScenario = _simScenario;
|
|
}
|
|
|
|
@Override
|
|
public LoadGeneratorModel getLoadGeneratorModel() {
|
|
return new IdleActiveLoadGenerator(numOfMobileDevice, simulationTime, simScenario);
|
|
}
|
|
|
|
@Override
|
|
public EdgeOrchestrator getEdgeOrchestrator() {
|
|
return new BasicEdgeOrchestrator(orchestratorPolicy, simScenario);
|
|
}
|
|
|
|
@Override
|
|
public MobilityModel getMobilityModel() {
|
|
return new NomadicMobility(numOfMobileDevice,simulationTime);
|
|
}
|
|
|
|
@Override
|
|
public NetworkModel getNetworkModel() {
|
|
return new MM1Queue(numOfMobileDevice, simScenario);
|
|
}
|
|
|
|
@Override
|
|
public EdgeServerManager getEdgeServerManager() {
|
|
return new DefaultEdgeServerManager();
|
|
}
|
|
|
|
@Override
|
|
public CloudServerManager getCloudServerManager() {
|
|
return new DefaultCloudServerManager();
|
|
}
|
|
|
|
@Override
|
|
public MobileDeviceManager getMobileDeviceManager() throws Exception {
|
|
return new DefaultMobileDeviceManager();
|
|
}
|
|
|
|
@Override
|
|
public MobileServerManager getMobileServerManager() {
|
|
return new DefaultMobileServerManager();
|
|
}
|
|
}
|