some minor backward compatible, major backward incompatible changes and code formatting (beautification)
Minor Modifications: * Indentation issues are fixed * Typo errors in source code and comments are fixed * Misspelled parameters in plotTaskFailureReason.m are corrected * sim_results folder is added to .gitignore file Backward compatible changes * The exit code of the application when there is an error is changed from 0 to 1 * Default constructors are added for Location.java, LoadGeneratorModel.java, MobilityModel.java, EdgeOrchestrator.java (this change request coming from a developer) * public TaskProperty(int mobileDeviceId, double startTime, ExponentialDistribution[] expRngList) is added to TaskProperty.java (this change request coming from a developer to create a task without task type) * double getCreationTime() function is added to Task.java * void reconfigureMips(double mips) function is added to EdgeVM (for future usage) * gsm_propagation_delay variable is added to config file. SimSettings class is also modified accordingly. You can use it if you have cellular network access in your scenario. * wlan_range, northern_bound, southern_bound, eastern_bound, western_bound variables are added to config file; and relevant functions are added to SimSettings class. (this change request coming from a developer) Backward incompatible changes! * location_check_interval variable name is changed to location_check_interval in config.properties file. Please update your config files accordingly (remove 'vm_' part) * Major modifications are applied in SimLogger class to decrease time complexity. Now the basic results are kept in the memory and saved to the files at the end of the simulation. As a result of this change, the signature of the SimLogger.addLog () function had to be changed. You must add the mobile device id as the first argument. Please update your MobileDeviceManager class accordingly (add task.getCloudletId () as the first argument).
This commit is contained in:
@@ -24,17 +24,17 @@ import edu.boun.edgecloudsim.utils.SimLogger;
|
||||
import edu.boun.edgecloudsim.utils.SimUtils;
|
||||
|
||||
public class MainApp {
|
||||
|
||||
|
||||
/**
|
||||
* Creates main() to run this example
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
//disable console output of cloudsim library
|
||||
Log.disable();
|
||||
|
||||
|
||||
//enable console output and file output of this application
|
||||
SimLogger.enablePrintLog();
|
||||
|
||||
|
||||
int iterationNumber = 1;
|
||||
String configFile = "";
|
||||
String outputFolder = "";
|
||||
@@ -61,12 +61,12 @@ public class MainApp {
|
||||
SimLogger.printLine("cannot initialize simulation settings!");
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
|
||||
if(SS.getFileLoggingEnabled()){
|
||||
SimLogger.enableFileLog();
|
||||
SimUtils.cleanOutputFolder(outputFolder);
|
||||
}
|
||||
|
||||
|
||||
DateFormat df = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
|
||||
Date SimulationStartDate = Calendar.getInstance().getTime();
|
||||
String now = df.format(SimulationStartDate);
|
||||
@@ -88,7 +88,7 @@ public class MainApp {
|
||||
SimLogger.printLine("Scenario: " + simScenario + " - Policy: " + orchestratorPolicy + " - #iteration: " + iterationNumber);
|
||||
SimLogger.printLine("Duration: " + SS.getSimulationTime()/60 + " min (warm up period: "+ SS.getWarmUpPeriod()/60 +" min) - #devices: " + j);
|
||||
SimLogger.getInstance().simStarted(outputFolder,"SIMRESULT_" + simScenario + "_" + orchestratorPolicy + "_" + j + "DEVICES");
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
// First step: Initialize the CloudSim package. It should be called
|
||||
@@ -96,16 +96,16 @@ public class MainApp {
|
||||
int num_user = 2; // number of grid users
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
boolean trace_flag = false; // mean trace events
|
||||
|
||||
|
||||
// Initialize the CloudSim library
|
||||
CloudSim.init(num_user, calendar, trace_flag, 0.01);
|
||||
|
||||
|
||||
// Generate EdgeCloudsim Scenario Factory
|
||||
ScenarioFactory sampleFactory = new SampleScenarioFactory(j,SS.getSimulationTime(), orchestratorPolicy, simScenario);
|
||||
|
||||
|
||||
// Generate EdgeCloudSim Simulation Manager
|
||||
SimManager manager = new SimManager(sampleFactory, j, simScenario, orchestratorPolicy);
|
||||
|
||||
|
||||
// Start simulation
|
||||
manager.startSimulation();
|
||||
}
|
||||
@@ -115,7 +115,7 @@ public class MainApp {
|
||||
e.printStackTrace();
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
|
||||
Date ScenarioEndDate = Calendar.getInstance().getTime();
|
||||
now = df.format(ScenarioEndDate);
|
||||
SimLogger.printLine("Scenario finished at " + now + ". It took " + SimUtils.getTimeDifference(ScenarioStartDate,ScenarioEndDate));
|
||||
|
||||
@@ -298,7 +298,8 @@ public class SampleMobileDeviceManager extends MobileDeviceManager {
|
||||
task.setSubmittedLocation(currentLocation);
|
||||
|
||||
//add related task to log list
|
||||
SimLogger.getInstance().addLog(task.getCloudletId(),
|
||||
SimLogger.getInstance().addLog(task.getMobileDeviceId(),
|
||||
task.getCloudletId(),
|
||||
task.getTaskType(),
|
||||
(int)task.getCloudletLength(),
|
||||
(int)task.getCloudletFileSize(),
|
||||
|
||||
Reference in New Issue
Block a user