major modifications for v2.0 release
Release notes 1- Cloud server processing was simplified in the initial version, it is handled via cloudsim components now. 2- Cloud server manager, edge server manager, mobile device manager and vm allocation policy are used as abstract class in factory pattern to allow developers to use different business logic without modifying EdgeCloudSim source code. 3- The task and place types are no longer defined as enumeration. They are used as integer value in order to manipulate more place type without modifying enum variable. 4- Two sample applications (one of them is simple and the other one extended application) are added along with the corresponding matlab files to plot statistics. 5- Cloud server properties are added to the simulation settings file 6- New log items are added to simulation result files 7- Code refactoring is applied including the modification of comments
This commit is contained in:
@@ -1,57 +1,59 @@
|
||||
/*
|
||||
* Title: EdgeCloudSim - Scenarion Factory interface
|
||||
*
|
||||
* Description:
|
||||
* ScenarioFactory responsible for providing customizable components
|
||||
* such as Network Model, Mobility Model, Edge Orchestrator.
|
||||
* This interface is very critical for using custom models on EdgeCloudSim
|
||||
* This interface should be implemented by EdgeCloudSim users
|
||||
*
|
||||
* Licence: GPL - http://www.gnu.org/copyleft/gpl.html
|
||||
* Copyright (c) 2017, Bogazici University, Istanbul, Turkey
|
||||
*/
|
||||
|
||||
package edu.boun.edgecloudsim.core;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.cloudbus.cloudsim.Host;
|
||||
import org.cloudbus.cloudsim.UtilizationModel;
|
||||
import org.cloudbus.cloudsim.VmAllocationPolicy;
|
||||
|
||||
import edu.boun.edgecloudsim.edge_orchestrator.EdgeOrchestrator;
|
||||
import edu.boun.edgecloudsim.mobility.MobilityModel;
|
||||
import edu.boun.edgecloudsim.task_generator.LoadGeneratorModel;
|
||||
import edu.boun.edgecloudsim.network.NetworkModel;
|
||||
|
||||
public interface ScenarioFactory {
|
||||
/**
|
||||
* provides abstract Load Generator Model
|
||||
*/
|
||||
public LoadGeneratorModel getLoadGeneratorModel();
|
||||
|
||||
/**
|
||||
* provides abstract Edge Orchestrator
|
||||
*/
|
||||
public EdgeOrchestrator getEdgeOrchestrator();
|
||||
|
||||
/**
|
||||
* provides abstract Mobility Model
|
||||
*/
|
||||
public MobilityModel getMobilityModel();
|
||||
|
||||
/**
|
||||
* provides abstract Network Model
|
||||
*/
|
||||
public NetworkModel getNetworkModel();
|
||||
|
||||
/**
|
||||
* provides abstract CPU Utilization Model
|
||||
*/
|
||||
public UtilizationModel getCpuUtilizationModel(SimSettings.APP_TYPES _taskType);
|
||||
|
||||
/**
|
||||
* provides abstract Vm Allocation Policy
|
||||
*/
|
||||
public VmAllocationPolicy getVmAllocationPolicy(List<? extends Host> list, int dataCenterIndex);
|
||||
}
|
||||
/*
|
||||
* Title: EdgeCloudSim - Scenarion Factory interface
|
||||
*
|
||||
* Description:
|
||||
* ScenarioFactory responsible for providing customizable components
|
||||
* such as Network Model, Mobility Model, Edge Orchestrator.
|
||||
* This interface is very critical for using custom models on EdgeCloudSim
|
||||
* This interface should be implemented by EdgeCloudSim users
|
||||
*
|
||||
* Licence: GPL - http://www.gnu.org/copyleft/gpl.html
|
||||
* Copyright (c) 2017, Bogazici University, Istanbul, Turkey
|
||||
*/
|
||||
|
||||
package edu.boun.edgecloudsim.core;
|
||||
|
||||
import edu.boun.edgecloudsim.cloud_server.CloudServerManager;
|
||||
import edu.boun.edgecloudsim.edge_client.MobileDeviceManager;
|
||||
import edu.boun.edgecloudsim.edge_orchestrator.EdgeOrchestrator;
|
||||
import edu.boun.edgecloudsim.edge_server.EdgeServerManager;
|
||||
import edu.boun.edgecloudsim.mobility.MobilityModel;
|
||||
import edu.boun.edgecloudsim.task_generator.LoadGeneratorModel;
|
||||
import edu.boun.edgecloudsim.network.NetworkModel;
|
||||
|
||||
public interface ScenarioFactory {
|
||||
/**
|
||||
* provides abstract Load Generator Model
|
||||
*/
|
||||
public LoadGeneratorModel getLoadGeneratorModel();
|
||||
|
||||
/**
|
||||
* provides abstract Edge Orchestrator
|
||||
*/
|
||||
public EdgeOrchestrator getEdgeOrchestrator();
|
||||
|
||||
/**
|
||||
* provides abstract Mobility Model
|
||||
*/
|
||||
public MobilityModel getMobilityModel();
|
||||
|
||||
/**
|
||||
* provides abstract Network Model
|
||||
*/
|
||||
public NetworkModel getNetworkModel();
|
||||
|
||||
/**
|
||||
* provides abstract Edge Server Model
|
||||
*/
|
||||
public EdgeServerManager getEdgeServerManager();
|
||||
|
||||
/**
|
||||
* provides abstract Cloud Server Model
|
||||
*/
|
||||
public CloudServerManager getCloudServerManager();
|
||||
|
||||
/**
|
||||
* provides abstract Mobile Device Manager Model
|
||||
*/
|
||||
public MobileDeviceManager getMobileDeviceManager() throws Exception;
|
||||
}
|
||||
|
||||
@@ -1,200 +1,251 @@
|
||||
/*
|
||||
* Title: EdgeCloudSim - Simulation Manager
|
||||
*
|
||||
* Description:
|
||||
* SimManager is an singleton class providing many abstract classeses such as
|
||||
* Network Model, Mobility Model, Edge Orchestrator to other modules
|
||||
* Critical simulation related information would be gathered via this class
|
||||
*
|
||||
* Licence: GPL - http://www.gnu.org/copyleft/gpl.html
|
||||
* Copyright (c) 2017, Bogazici University, Istanbul, Turkey
|
||||
*/
|
||||
|
||||
package edu.boun.edgecloudsim.core;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.cloudbus.cloudsim.Log;
|
||||
import org.cloudbus.cloudsim.core.CloudSim;
|
||||
import org.cloudbus.cloudsim.core.SimEntity;
|
||||
import org.cloudbus.cloudsim.core.SimEvent;
|
||||
|
||||
import edu.boun.edgecloudsim.edge_orchestrator.EdgeOrchestrator;
|
||||
import edu.boun.edgecloudsim.edge_server.EdgeServerManager;
|
||||
import edu.boun.edgecloudsim.edge_server.VmAllocationPolicy_Custom;
|
||||
import edu.boun.edgecloudsim.edge_client.MobileDeviceManager;
|
||||
import edu.boun.edgecloudsim.mobility.MobilityModel;
|
||||
import edu.boun.edgecloudsim.task_generator.LoadGeneratorModel;
|
||||
import edu.boun.edgecloudsim.network.NetworkModel;
|
||||
import edu.boun.edgecloudsim.utils.EdgeTask;
|
||||
import edu.boun.edgecloudsim.utils.SimLogger;
|
||||
|
||||
public class SimManager extends SimEntity {
|
||||
private static final int CREATE_TASK = 0;
|
||||
private static final int CHECK_ALL_VM = 1;
|
||||
private static final int GET_LOAD_LOG = 2;
|
||||
private static final int PRINT_PROGRESS = 3;
|
||||
private static final int STOP_SIMULATION = 4;
|
||||
|
||||
private int numOfMobileDevice;
|
||||
private NetworkModel networkModel;
|
||||
private MobilityModel mobilityModel;
|
||||
private ScenarioFactory scenarioFactory;
|
||||
private EdgeOrchestrator edgeOrchestrator;
|
||||
private EdgeServerManager edgeServerManager;
|
||||
private LoadGeneratorModel loadGeneratorModel;
|
||||
private MobileDeviceManager mobileDeviceManager;
|
||||
|
||||
private static SimManager instance = null;
|
||||
|
||||
public SimManager(ScenarioFactory _scenarioFactory, int _numOfMobileDevice, String _simScenario) throws Exception {
|
||||
super("SimManager");
|
||||
scenarioFactory = _scenarioFactory;
|
||||
numOfMobileDevice = _numOfMobileDevice;
|
||||
|
||||
SimLogger.print("Creating tasks...");
|
||||
loadGeneratorModel = scenarioFactory.getLoadGeneratorModel();
|
||||
loadGeneratorModel.initializeModel();
|
||||
SimLogger.printLine("Done, ");
|
||||
|
||||
SimLogger.print("Creating device locations...");
|
||||
mobilityModel = scenarioFactory.getMobilityModel();
|
||||
mobilityModel.initialize();
|
||||
SimLogger.printLine("Done.");
|
||||
|
||||
//Generate network model
|
||||
networkModel = scenarioFactory.getNetworkModel();
|
||||
networkModel.initialize();
|
||||
|
||||
//Generate edge orchestrator
|
||||
edgeOrchestrator = scenarioFactory.getEdgeOrchestrator();
|
||||
edgeOrchestrator.initialize();
|
||||
|
||||
//Create Physical Servers
|
||||
edgeServerManager = new EdgeServerManager();
|
||||
|
||||
//Create Client Manager
|
||||
mobileDeviceManager = new MobileDeviceManager();
|
||||
|
||||
instance = this;
|
||||
}
|
||||
|
||||
public static SimManager getInstance(){
|
||||
return instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Triggering CloudSim to start simulation
|
||||
*/
|
||||
public void startSimulation() throws Exception{
|
||||
//Starts the simulation
|
||||
SimLogger.print(super.getName()+" is starting...");
|
||||
|
||||
//Start Edge Servers & Generate VMs
|
||||
edgeServerManager.startDatacenters();
|
||||
edgeServerManager.createVmList(mobileDeviceManager.getId());
|
||||
|
||||
CloudSim.startSimulation();
|
||||
}
|
||||
|
||||
public ScenarioFactory getScenarioFactory(){
|
||||
return scenarioFactory;
|
||||
}
|
||||
|
||||
public int getNumOfMobileDevice(){
|
||||
return numOfMobileDevice;
|
||||
}
|
||||
|
||||
public NetworkModel getNetworkModel(){
|
||||
return networkModel;
|
||||
}
|
||||
|
||||
public MobilityModel getMobilityModel(){
|
||||
return mobilityModel;
|
||||
}
|
||||
|
||||
public EdgeOrchestrator getEdgeOrchestrator(){
|
||||
return edgeOrchestrator;
|
||||
}
|
||||
|
||||
public EdgeServerManager getLocalServerManager(){
|
||||
return edgeServerManager;
|
||||
}
|
||||
|
||||
public MobileDeviceManager getMobileDeviceManager(){
|
||||
return mobileDeviceManager;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startEntity() {
|
||||
for(int i=0; i<edgeServerManager.getDatacenterList().size(); i++)
|
||||
mobileDeviceManager.submitVmList(edgeServerManager.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));
|
||||
|
||||
//Periodic event loops starts from here!
|
||||
schedule(getId(), 5, CHECK_ALL_VM);
|
||||
schedule(getId(), SimSettings.getInstance().getSimulationTime()/100, PRINT_PROGRESS);
|
||||
schedule(getId(), SimSettings.getInstance().getVmLoadLogInterval(), GET_LOAD_LOG);
|
||||
schedule(getId(), SimSettings.getInstance().getSimulationTime(), STOP_SIMULATION);
|
||||
|
||||
SimLogger.printLine("Done.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processEvent(SimEvent ev) {
|
||||
synchronized(this){
|
||||
switch (ev.getTag()) {
|
||||
case CREATE_TASK:
|
||||
try {
|
||||
EdgeTask edgeTask = (EdgeTask) ev.getData();
|
||||
mobileDeviceManager.submitTask(edgeTask);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
System.exit(0);
|
||||
}
|
||||
break;
|
||||
case CHECK_ALL_VM:
|
||||
int totalNumOfVm = SimSettings.getInstance().getNumOfEdgeVMs();
|
||||
if(VmAllocationPolicy_Custom.getCreatedVmNum() != totalNumOfVm){
|
||||
SimLogger.printLine("All VMs cannot be created! Terminating simulation...");
|
||||
System.exit(0);
|
||||
}
|
||||
break;
|
||||
case GET_LOAD_LOG:
|
||||
SimLogger.getInstance().addVmUtilizationLog(CloudSim.clock(),edgeServerManager.getAvgUtilization());
|
||||
schedule(getId(), SimSettings.getInstance().getVmLoadLogInterval(), GET_LOAD_LOG);
|
||||
break;
|
||||
case PRINT_PROGRESS:
|
||||
int progress = (int)((CloudSim.clock()*100)/SimSettings.getInstance().getSimulationTime());
|
||||
if(progress % 10 == 0)
|
||||
SimLogger.print(Integer.toString(progress));
|
||||
else
|
||||
SimLogger.print(".");
|
||||
if(CloudSim.clock() < SimSettings.getInstance().getSimulationTime())
|
||||
schedule(getId(), SimSettings.getInstance().getSimulationTime()/100, PRINT_PROGRESS);
|
||||
break;
|
||||
case STOP_SIMULATION:
|
||||
SimLogger.printLine("100");
|
||||
CloudSim.terminateSimulation();
|
||||
try {
|
||||
SimLogger.getInstance().simStopped();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
System.exit(0);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
Log.printLine(getName() + ": unknown event type");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shutdownEntity() {
|
||||
edgeServerManager.terminateDatacenters();
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Title: EdgeCloudSim - Simulation Manager
|
||||
*
|
||||
* Description:
|
||||
* SimManager is an singleton class providing many abstract classeses such as
|
||||
* Network Model, Mobility Model, Edge Orchestrator to other modules
|
||||
* Critical simulation related information would be gathered via this class
|
||||
*
|
||||
* Licence: GPL - http://www.gnu.org/copyleft/gpl.html
|
||||
* Copyright (c) 2017, Bogazici University, Istanbul, Turkey
|
||||
*/
|
||||
|
||||
package edu.boun.edgecloudsim.core;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import org.cloudbus.cloudsim.Host;
|
||||
import org.cloudbus.cloudsim.Log;
|
||||
import org.cloudbus.cloudsim.core.CloudSim;
|
||||
import org.cloudbus.cloudsim.core.SimEntity;
|
||||
import org.cloudbus.cloudsim.core.SimEvent;
|
||||
|
||||
import edu.boun.edgecloudsim.edge_orchestrator.EdgeOrchestrator;
|
||||
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.mobility.MobilityModel;
|
||||
import edu.boun.edgecloudsim.task_generator.LoadGeneratorModel;
|
||||
import edu.boun.edgecloudsim.network.NetworkModel;
|
||||
import edu.boun.edgecloudsim.utils.EdgeTask;
|
||||
import edu.boun.edgecloudsim.utils.SimLogger;
|
||||
|
||||
public class SimManager extends SimEntity {
|
||||
private static final int CREATE_TASK = 0;
|
||||
private static final int CHECK_ALL_VM = 1;
|
||||
private static final int GET_LOAD_LOG = 2;
|
||||
private static final int PRINT_PROGRESS = 3;
|
||||
private static final int STOP_SIMULATION = 4;
|
||||
|
||||
private String simScenario;
|
||||
private String orchestratorPolicy;
|
||||
private int numOfMobileDevice;
|
||||
private NetworkModel networkModel;
|
||||
private MobilityModel mobilityModel;
|
||||
private ScenarioFactory scenarioFactory;
|
||||
private EdgeOrchestrator edgeOrchestrator;
|
||||
private EdgeServerManager edgeServerManager;
|
||||
private CloudServerManager cloudServerManager;
|
||||
private LoadGeneratorModel loadGeneratorModel;
|
||||
private MobileDeviceManager mobileDeviceManager;
|
||||
|
||||
private static SimManager instance = null;
|
||||
|
||||
public SimManager(ScenarioFactory _scenarioFactory, int _numOfMobileDevice, String _simScenario, String _orchestratorPolicy) throws Exception {
|
||||
super("SimManager");
|
||||
simScenario = _simScenario;
|
||||
scenarioFactory = _scenarioFactory;
|
||||
numOfMobileDevice = _numOfMobileDevice;
|
||||
orchestratorPolicy = _orchestratorPolicy;
|
||||
|
||||
SimLogger.print("Creating tasks...");
|
||||
loadGeneratorModel = scenarioFactory.getLoadGeneratorModel();
|
||||
loadGeneratorModel.initializeModel();
|
||||
SimLogger.printLine("Done, ");
|
||||
|
||||
SimLogger.print("Creating device locations...");
|
||||
mobilityModel = scenarioFactory.getMobilityModel();
|
||||
mobilityModel.initialize();
|
||||
SimLogger.printLine("Done.");
|
||||
|
||||
//Generate network model
|
||||
networkModel = scenarioFactory.getNetworkModel();
|
||||
networkModel.initialize();
|
||||
|
||||
//Generate edge orchestrator
|
||||
edgeOrchestrator = scenarioFactory.getEdgeOrchestrator();
|
||||
edgeOrchestrator.initialize();
|
||||
|
||||
//Create Physical Servers
|
||||
edgeServerManager = scenarioFactory.getEdgeServerManager();
|
||||
edgeServerManager.initialize();
|
||||
|
||||
//Create Physical Servers on cloud
|
||||
cloudServerManager = scenarioFactory.getCloudServerManager();
|
||||
cloudServerManager.initialize();
|
||||
|
||||
//Create Client Manager
|
||||
mobileDeviceManager = scenarioFactory.getMobileDeviceManager();
|
||||
mobileDeviceManager.initialize();
|
||||
|
||||
instance = this;
|
||||
}
|
||||
|
||||
public static SimManager getInstance(){
|
||||
return instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Triggering CloudSim to start simulation
|
||||
*/
|
||||
public void startSimulation() throws Exception{
|
||||
//Starts the simulation
|
||||
SimLogger.print(super.getName()+" is starting...");
|
||||
|
||||
//Start Edge Datacenters & Generate VMs
|
||||
edgeServerManager.startDatacenters();
|
||||
edgeServerManager.createVmList(mobileDeviceManager.getId());
|
||||
|
||||
//Start Edge Datacenters & Generate VMs
|
||||
cloudServerManager.startDatacenters();
|
||||
cloudServerManager.createVmList(mobileDeviceManager.getId());
|
||||
|
||||
CloudSim.startSimulation();
|
||||
}
|
||||
|
||||
public String getSimulationScenario(){
|
||||
return simScenario;
|
||||
}
|
||||
|
||||
public String getOrchestratorPolicy(){
|
||||
return orchestratorPolicy;
|
||||
}
|
||||
|
||||
public ScenarioFactory getScenarioFactory(){
|
||||
return scenarioFactory;
|
||||
}
|
||||
|
||||
public int getNumOfMobileDevice(){
|
||||
return numOfMobileDevice;
|
||||
}
|
||||
|
||||
public NetworkModel getNetworkModel(){
|
||||
return networkModel;
|
||||
}
|
||||
|
||||
public MobilityModel getMobilityModel(){
|
||||
return mobilityModel;
|
||||
}
|
||||
|
||||
public EdgeOrchestrator getEdgeOrchestrator(){
|
||||
return edgeOrchestrator;
|
||||
}
|
||||
|
||||
public EdgeServerManager getEdgeServerManager(){
|
||||
return edgeServerManager;
|
||||
}
|
||||
|
||||
public CloudServerManager getCloudServerManager(){
|
||||
return cloudServerManager;
|
||||
}
|
||||
|
||||
public LoadGeneratorModel getLoadGeneratorModel(){
|
||||
return loadGeneratorModel;
|
||||
}
|
||||
|
||||
public MobileDeviceManager getMobileDeviceManager(){
|
||||
return mobileDeviceManager;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startEntity() {
|
||||
int hostCounter=0;
|
||||
|
||||
for(int i= 0; i<edgeServerManager.getDatacenterList().size(); i++) {
|
||||
List<? extends Host> list = edgeServerManager.getDatacenterList().get(i).getHostList();
|
||||
for (int j=0; j < list.size(); j++) {
|
||||
mobileDeviceManager.submitVmList(edgeServerManager.getVmList(hostCounter));
|
||||
hostCounter++;
|
||||
}
|
||||
}
|
||||
|
||||
for(int i= 0; i<SimSettings.getInstance().getNumOfCoudHost(); i++) {
|
||||
mobileDeviceManager.submitVmList(cloudServerManager.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));
|
||||
|
||||
//Periodic event loops starts from here!
|
||||
schedule(getId(), 5, CHECK_ALL_VM);
|
||||
schedule(getId(), SimSettings.getInstance().getSimulationTime()/100, PRINT_PROGRESS);
|
||||
schedule(getId(), SimSettings.getInstance().getVmLoadLogInterval(), GET_LOAD_LOG);
|
||||
schedule(getId(), SimSettings.getInstance().getSimulationTime(), STOP_SIMULATION);
|
||||
|
||||
SimLogger.printLine("Done.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processEvent(SimEvent ev) {
|
||||
synchronized(this){
|
||||
switch (ev.getTag()) {
|
||||
case CREATE_TASK:
|
||||
try {
|
||||
EdgeTask edgeTask = (EdgeTask) ev.getData();
|
||||
mobileDeviceManager.submitTask(edgeTask);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
System.exit(0);
|
||||
}
|
||||
break;
|
||||
case CHECK_ALL_VM:
|
||||
int totalNumOfVm = SimSettings.getInstance().getNumOfEdgeVMs();
|
||||
if(EdgeVmAllocationPolicy_Custom.getCreatedVmNum() != totalNumOfVm){
|
||||
SimLogger.printLine("All VMs cannot be created! Terminating simulation...");
|
||||
System.exit(0);
|
||||
}
|
||||
break;
|
||||
case GET_LOAD_LOG:
|
||||
SimLogger.getInstance().addVmUtilizationLog(
|
||||
CloudSim.clock(),
|
||||
edgeServerManager.getAvgUtilization(),
|
||||
cloudServerManager.getAvgUtilization());
|
||||
|
||||
schedule(getId(), SimSettings.getInstance().getVmLoadLogInterval(), GET_LOAD_LOG);
|
||||
break;
|
||||
case PRINT_PROGRESS:
|
||||
int progress = (int)((CloudSim.clock()*100)/SimSettings.getInstance().getSimulationTime());
|
||||
if(progress % 10 == 0)
|
||||
SimLogger.print(Integer.toString(progress));
|
||||
else
|
||||
SimLogger.print(".");
|
||||
if(CloudSim.clock() < SimSettings.getInstance().getSimulationTime())
|
||||
schedule(getId(), SimSettings.getInstance().getSimulationTime()/100, PRINT_PROGRESS);
|
||||
|
||||
break;
|
||||
case STOP_SIMULATION:
|
||||
SimLogger.printLine("100");
|
||||
CloudSim.terminateSimulation();
|
||||
try {
|
||||
SimLogger.getInstance().simStopped();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
System.exit(0);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
Log.printLine(getName() + ": unknown event type");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shutdownEntity() {
|
||||
edgeServerManager.terminateDatacenters();
|
||||
cloudServerManager.terminateDatacenters();
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user