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:
parent
1b4a02e7e6
commit
08341c3681
3
.gitignore
vendored
3
.gitignore
vendored
@ -15,6 +15,9 @@ Desktop.ini
|
|||||||
# bin folder
|
# bin folder
|
||||||
bin
|
bin
|
||||||
|
|
||||||
|
# simulation output folder
|
||||||
|
sim_results
|
||||||
|
|
||||||
# eclipse's files
|
# eclipse's files
|
||||||
.settings
|
.settings
|
||||||
.classpath
|
.classpath
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
simulation_time=30
|
simulation_time=30
|
||||||
warm_up_period=3
|
warm_up_period=3
|
||||||
vm_load_check_interval=0.1
|
vm_load_check_interval=0.1
|
||||||
vm_location_check_interval=0.1
|
location_check_interval=0.1
|
||||||
file_log_enabled=true
|
file_log_enabled=true
|
||||||
deep_file_log_enabled=false
|
deep_file_log_enabled=false
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ function [] = plotGenericResult(rowOfset, columnOfset, yLabel, appType, calculat
|
|||||||
for j=1:numOfMobileDevices
|
for j=1:numOfMobileDevices
|
||||||
try
|
try
|
||||||
mobileDeviceNumber = startOfMobileDeviceLoop + stepOfMobileDeviceLoop * (j-1);
|
mobileDeviceNumber = startOfMobileDeviceLoop + stepOfMobileDeviceLoop * (j-1);
|
||||||
filePath = strcat(folderPath,'\ite',int2str(s),'\SIMRESULT_',char(scenarioType(i)),'_NEXT_FIT_',int2str(mobileDeviceNumber),'DEVICES_',appType,'_GENERIC.log')
|
filePath = strcat(folderPath,'\ite',int2str(s),'\SIMRESULT_',char(scenarioType(i)),'_NEXT_FIT_',int2str(mobileDeviceNumber),'DEVICES_',appType,'_GENERIC.log');
|
||||||
|
|
||||||
readData = dlmread(filePath,';',rowOfset,0);
|
readData = dlmread(filePath,';',rowOfset,0);
|
||||||
value = readData(1,columnOfset);
|
value = readData(1,columnOfset);
|
||||||
|
@ -1,27 +1,27 @@
|
|||||||
function [] = plotTaskFailureReason()
|
function [] = plotTaskFailureReason()
|
||||||
|
|
||||||
plotGenericResult(1, 10, 'Failed Task due to VM Capacity (%)', 'ALL_APPS', 'percentage_for_failed');
|
plotGenericResult(1, 10, 'Failed Task due to VM Capacity (%)', 'ALL_APPS', 'percentage_for_failed');
|
||||||
plotGenericResult(1, 10, {'Failed Task due to VM Capacity';'for Augmented Reality App (%)'}, 'AUGMENTED_REALITY', 'for_failed');
|
plotGenericResult(1, 10, {'Failed Task due to VM Capacity';'for Augmented Reality App (%)'}, 'AUGMENTED_REALITY', 'percentage_for_failed');
|
||||||
plotGenericResult(1, 10, {'Failed Task due to VM Capacity';'for Health App (%)'}, 'HEALTH_APP', 'for_failed');
|
plotGenericResult(1, 10, {'Failed Task due to VM Capacity';'for Health App (%)'}, 'HEALTH_APP', 'percentage_for_failed');
|
||||||
plotGenericResult(1, 10, {'Failed Task due to VM Capacity';'for Infotainment App (%)'}, 'INFOTAINMENT_APP', 'for_failed');
|
plotGenericResult(1, 10, {'Failed Task due to VM Capacity';'for Infotainment App (%)'}, 'INFOTAINMENT_APP', 'percentage_for_failed');
|
||||||
plotGenericResult(1, 10, {'Failed Task due to VM Capacity';'for Heavy Computation App (%)'}, 'HEAVY_COMP_APP', 'for_failed');
|
plotGenericResult(1, 10, {'Failed Task due to VM Capacity';'for Heavy Computation App (%)'}, 'HEAVY_COMP_APP', 'percentage_for_failed');
|
||||||
|
|
||||||
plotGenericResult(1, 11, 'Failed Task due to Mobility (%)', 'ALL_APPS', 'percentage_for_failed');
|
plotGenericResult(1, 11, 'Failed Task due to Mobility (%)', 'ALL_APPS', 'percentage_for_failed');
|
||||||
plotGenericResult(1, 11, {'Failed Task due to Mobility';'for Augmented Reality App (%)'}, 'AUGMENTED_REALITY', 'for_failed');
|
plotGenericResult(1, 11, {'Failed Task due to Mobility';'for Augmented Reality App (%)'}, 'AUGMENTED_REALITY', 'percentage_for_failed');
|
||||||
plotGenericResult(1, 11, {'Failed Task due to Mobility';'for Health App (%)'}, 'HEALTH_APP', 'for_failed');
|
plotGenericResult(1, 11, {'Failed Task due to Mobility';'for Health App (%)'}, 'HEALTH_APP', 'percentage_for_failed');
|
||||||
plotGenericResult(1, 11, {'Failed Task due to Mobility';'for Infotainment App (%)'}, 'INFOTAINMENT_APP', 'for_failed');
|
plotGenericResult(1, 11, {'Failed Task due to Mobility';'for Infotainment App (%)'}, 'INFOTAINMENT_APP', 'percentage_for_failed');
|
||||||
plotGenericResult(1, 11, {'Failed Task due to Mobility';'for Heavy Computation App (%)'}, 'HEAVY_COMP_APP', 'for_failed');
|
plotGenericResult(1, 11, {'Failed Task due to Mobility';'for Heavy Computation App (%)'}, 'HEAVY_COMP_APP', 'percentage_for_failed');
|
||||||
|
|
||||||
plotGenericResult(5, 5, 'Failed Tasks due to WLAN failure (%)', 'ALL_APPS', 'percentage_for_failed');
|
plotGenericResult(5, 5, 'Failed Tasks due to WLAN failure (%)', 'ALL_APPS', 'percentage_for_failed');
|
||||||
plotGenericResult(5, 5, {'Failed Tasks due to WLAN failure';'for Augmented Reality App (%)'}, 'AUGMENTED_REALITY', 'for_failed');
|
plotGenericResult(5, 5, {'Failed Tasks due to WLAN failure';'for Augmented Reality App (%)'}, 'AUGMENTED_REALITY', 'percentage_for_failed');
|
||||||
plotGenericResult(5, 5, {'Failed Tasks due to WLAN failure';'for Health App (%)'}, 'HEALTH_APP', 'for_failed');
|
plotGenericResult(5, 5, {'Failed Tasks due to WLAN failure';'for Health App (%)'}, 'HEALTH_APP', 'percentage_for_failed');
|
||||||
plotGenericResult(5, 5, {'Failed Tasks due to WLAN failure';'for Infotainment App (%)'}, 'INFOTAINMENT_APP', 'for_failed');
|
plotGenericResult(5, 5, {'Failed Tasks due to WLAN failure';'for Infotainment App (%)'}, 'INFOTAINMENT_APP', 'percentage_for_failed');
|
||||||
plotGenericResult(5, 5, {'Failed Tasks due to WLAN failure';'for Heavy Comp. App (%)'}, 'HEAVY_COMP_APP', 'for_failed');
|
plotGenericResult(5, 5, {'Failed Tasks due to WLAN failure';'for Heavy Comp. App (%)'}, 'HEAVY_COMP_APP', 'percentage_for_failed');
|
||||||
|
|
||||||
plotGenericResult(5, 7, 'Failed Tasks due to WAN failure (%)', 'ALL_APPS', 'percentage_for_failed');
|
plotGenericResult(5, 7, 'Failed Tasks due to WAN failure (%)', 'ALL_APPS', 'percentage_for_failed');
|
||||||
plotGenericResult(5, 7, {'Failed Tasks due to WAN failure';'for Augmented Reality App (%)'}, 'AUGMENTED_REALITY', 'for_failed');
|
plotGenericResult(5, 7, {'Failed Tasks due to WAN failure';'for Augmented Reality App (%)'}, 'AUGMENTED_REALITY', 'percentage_for_failed');
|
||||||
plotGenericResult(5, 7, {'Failed Tasks due to WAN failure';'for Health App (%)'}, 'HEALTH_APP', 'for_failed');
|
plotGenericResult(5, 7, {'Failed Tasks due to WAN failure';'for Health App (%)'}, 'HEALTH_APP', 'percentage_for_failed');
|
||||||
plotGenericResult(5, 7, {'Failed Tasks due to WAN failure';'for Infotainment App (%)'}, 'INFOTAINMENT_APP', 'for_failed');
|
plotGenericResult(5, 7, {'Failed Tasks due to WAN failure';'for Infotainment App (%)'}, 'INFOTAINMENT_APP', 'percentage_for_failed');
|
||||||
plotGenericResult(5, 7, {'Failed Tasks due to WAN failure';'for Heavy Comp. App (%)'}, 'HEAVY_COMP_APP', 'for_failed');
|
plotGenericResult(5, 7, {'Failed Tasks due to WAN failure';'for Heavy Comp. App (%)'}, 'HEAVY_COMP_APP', 'percentage_for_failed');
|
||||||
|
|
||||||
end
|
end
|
@ -2,7 +2,7 @@
|
|||||||
simulation_time=30
|
simulation_time=30
|
||||||
warm_up_period=3
|
warm_up_period=3
|
||||||
vm_load_check_interval=0.1
|
vm_load_check_interval=0.1
|
||||||
vm_location_check_interval=0.1
|
location_check_interval=0.1
|
||||||
file_log_enabled=true
|
file_log_enabled=true
|
||||||
deep_file_log_enabled=false
|
deep_file_log_enabled=false
|
||||||
|
|
||||||
|
@ -1,33 +1,33 @@
|
|||||||
function [] = plotTaskFailureReason()
|
function [] = plotTaskFailureReason()
|
||||||
|
|
||||||
plotGenericResult(1, 10, 'Failed Task due to VM Capacity (%)', 'ALL_APPS', 'percentage_for_failed');
|
plotGenericResult(1, 10, 'Failed Task due to VM Capacity (%)', 'ALL_APPS', 'percentage_for_failed');
|
||||||
plotGenericResult(1, 10, {'Failed Task due to VM Capacity';'for Augmented Reality App (%)'}, 'AUGMENTED_REALITY', 'for_failed');
|
plotGenericResult(1, 10, {'Failed Task due to VM Capacity';'for Augmented Reality App (%)'}, 'AUGMENTED_REALITY', 'percentage_for_failed');
|
||||||
plotGenericResult(1, 10, {'Failed Task due to VM Capacity';'for Health App (%)'}, 'HEALTH_APP', 'for_failed');
|
plotGenericResult(1, 10, {'Failed Task due to VM Capacity';'for Health App (%)'}, 'HEALTH_APP', 'percentage_for_failed');
|
||||||
plotGenericResult(1, 10, {'Failed Task due to VM Capacity';'for Infotainment App (%)'}, 'INFOTAINMENT_APP', 'for_failed');
|
plotGenericResult(1, 10, {'Failed Task due to VM Capacity';'for Infotainment App (%)'}, 'INFOTAINMENT_APP', 'percentage_for_failed');
|
||||||
plotGenericResult(1, 10, {'Failed Task due to VM Capacity';'for Heavy Computation App (%)'}, 'HEAVY_COMP_APP', 'for_failed');
|
plotGenericResult(1, 10, {'Failed Task due to VM Capacity';'for Heavy Computation App (%)'}, 'HEAVY_COMP_APP', 'percentage_for_failed');
|
||||||
|
|
||||||
plotGenericResult(1, 11, 'Failed Task due to Mobility (%)', 'ALL_APPS', 'percentage_for_failed');
|
plotGenericResult(1, 11, 'Failed Task due to Mobility (%)', 'ALL_APPS', 'percentage_for_failed');
|
||||||
plotGenericResult(1, 11, {'Failed Task due to Mobility';'for Augmented Reality App (%)'}, 'AUGMENTED_REALITY', 'for_failed');
|
plotGenericResult(1, 11, {'Failed Task due to Mobility';'for Augmented Reality App (%)'}, 'AUGMENTED_REALITY', 'percentage_for_failed');
|
||||||
plotGenericResult(1, 11, {'Failed Task due to Mobility';'for Health App (%)'}, 'HEALTH_APP', 'for_failed');
|
plotGenericResult(1, 11, {'Failed Task due to Mobility';'for Health App (%)'}, 'HEALTH_APP', 'percentage_for_failed');
|
||||||
plotGenericResult(1, 11, {'Failed Task due to Mobility';'for Infotainment App (%)'}, 'INFOTAINMENT_APP', 'for_failed');
|
plotGenericResult(1, 11, {'Failed Task due to Mobility';'for Infotainment App (%)'}, 'INFOTAINMENT_APP', 'percentage_for_failed');
|
||||||
plotGenericResult(1, 11, {'Failed Task due to Mobility';'for Heavy Computation App (%)'}, 'HEAVY_COMP_APP', 'for_failed');
|
plotGenericResult(1, 11, {'Failed Task due to Mobility';'for Heavy Computation App (%)'}, 'HEAVY_COMP_APP', 'percentage_for_failed');
|
||||||
|
|
||||||
plotGenericResult(5, 5, 'Failed Tasks due to WLAN failure (%)', 'ALL_APPS', 'percentage_for_failed');
|
plotGenericResult(5, 5, 'Failed Tasks due to WLAN failure (%)', 'ALL_APPS', 'percentage_for_failed');
|
||||||
plotGenericResult(5, 5, {'Failed Tasks due to WLAN failure';'for Augmented Reality App (%)'}, 'AUGMENTED_REALITY', 'for_failed');
|
plotGenericResult(5, 5, {'Failed Tasks due to WLAN failure';'for Augmented Reality App (%)'}, 'AUGMENTED_REALITY', 'percentage_for_failed');
|
||||||
plotGenericResult(5, 5, {'Failed Tasks due to WLAN failure';'for Health App (%)'}, 'HEALTH_APP', 'for_failed');
|
plotGenericResult(5, 5, {'Failed Tasks due to WLAN failure';'for Health App (%)'}, 'HEALTH_APP', 'percentage_for_failed');
|
||||||
plotGenericResult(5, 5, {'Failed Tasks due to WLAN failure';'for Infotainment App (%)'}, 'INFOTAINMENT_APP', 'for_failed');
|
plotGenericResult(5, 5, {'Failed Tasks due to WLAN failure';'for Infotainment App (%)'}, 'INFOTAINMENT_APP', 'percentage_for_failed');
|
||||||
plotGenericResult(5, 5, {'Failed Tasks due to WLAN failure';'for Heavy Comp. App (%)'}, 'HEAVY_COMP_APP', 'for_failed');
|
plotGenericResult(5, 5, {'Failed Tasks due to WLAN failure';'for Heavy Comp. App (%)'}, 'HEAVY_COMP_APP', 'percentage_for_failed');
|
||||||
|
|
||||||
plotGenericResult(5, 6, 'Failed Tasks due to MAN failure (%)', 'ALL_APPS', 'percentage_for_failed');
|
plotGenericResult(5, 6, 'Failed Tasks due to MAN failure (%)', 'ALL_APPS', 'percentage_for_failed');
|
||||||
plotGenericResult(5, 6, {'Failed Tasks due to MAN failure';'for Augmented Reality App (%)'}, 'AUGMENTED_REALITY', 'for_failed');
|
plotGenericResult(5, 6, {'Failed Tasks due to MAN failure';'for Augmented Reality App (%)'}, 'AUGMENTED_REALITY', 'percentage_for_failed');
|
||||||
plotGenericResult(5, 6, {'Failed Tasks due to MAN failure';'for Health App (%)'}, 'HEALTH_APP', 'for_failed');
|
plotGenericResult(5, 6, {'Failed Tasks due to MAN failure';'for Health App (%)'}, 'HEALTH_APP', 'percentage_for_failed');
|
||||||
plotGenericResult(5, 6, {'Failed Tasks due to MAN failure';'for Infotainment App (%)'}, 'INFOTAINMENT_APP', 'for_failed');
|
plotGenericResult(5, 6, {'Failed Tasks due to MAN failure';'for Infotainment App (%)'}, 'INFOTAINMENT_APP', 'percentage_for_failed');
|
||||||
plotGenericResult(5, 6, {'Failed Tasks due to MAN failure';'for Heavy Comp. App (%)'}, 'HEAVY_COMP_APP', 'for_failed');
|
plotGenericResult(5, 6, {'Failed Tasks due to MAN failure';'for Heavy Comp. App (%)'}, 'HEAVY_COMP_APP', 'percentage_for_failed');
|
||||||
|
|
||||||
plotGenericResult(5, 7, 'Failed Tasks due to WAN failure (%)', 'ALL_APPS', 'percentage_for_failed');
|
plotGenericResult(5, 7, 'Failed Tasks due to WAN failure (%)', 'ALL_APPS', 'percentage_for_failed');
|
||||||
plotGenericResult(5, 7, {'Failed Tasks due to WAN failure';'for Augmented Reality App (%)'}, 'AUGMENTED_REALITY', 'for_failed');
|
plotGenericResult(5, 7, {'Failed Tasks due to WAN failure';'for Augmented Reality App (%)'}, 'AUGMENTED_REALITY', 'percentage_for_failed');
|
||||||
plotGenericResult(5, 7, {'Failed Tasks due to WAN failure';'for Health App (%)'}, 'HEALTH_APP', 'for_failed');
|
plotGenericResult(5, 7, {'Failed Tasks due to WAN failure';'for Health App (%)'}, 'HEALTH_APP', 'percentage_for_failed');
|
||||||
plotGenericResult(5, 7, {'Failed Tasks due to WAN failure';'for Infotainment App (%)'}, 'INFOTAINMENT_APP', 'for_failed');
|
plotGenericResult(5, 7, {'Failed Tasks due to WAN failure';'for Infotainment App (%)'}, 'INFOTAINMENT_APP', 'percentage_for_failed');
|
||||||
plotGenericResult(5, 7, {'Failed Tasks due to WAN failure';'for Heavy Comp. App (%)'}, 'HEAVY_COMP_APP', 'for_failed');
|
plotGenericResult(5, 7, {'Failed Tasks due to WAN failure';'for Heavy Comp. App (%)'}, 'HEAVY_COMP_APP', 'percentage_for_failed');
|
||||||
|
|
||||||
end
|
end
|
@ -2,7 +2,7 @@
|
|||||||
simulation_time=33
|
simulation_time=33
|
||||||
warm_up_period=3
|
warm_up_period=3
|
||||||
vm_load_check_interval=0.1
|
vm_load_check_interval=0.1
|
||||||
vm_location_check_interval=0.1
|
location_check_interval=0.1
|
||||||
file_log_enabled=true
|
file_log_enabled=true
|
||||||
deep_file_log_enabled=false
|
deep_file_log_enabled=false
|
||||||
|
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
function [] = plotTaskFailureReason()
|
function [] = plotTaskFailureReason()
|
||||||
|
|
||||||
plotGenericResult(1, 10, 'Failed Task due to VM Capacity (%)', 'ALL_APPS', 'percentage_for_failed');
|
plotGenericResult(1, 10, 'Failed Task due to VM Capacity (%)', 'ALL_APPS', 'percentage_for_failed');
|
||||||
plotGenericResult(1, 10, {'Failed Task due to VM Capacity';'for Augmented Reality App (%)'}, 'AUGMENTED_REALITY', 'for_failed');
|
plotGenericResult(1, 10, {'Failed Task due to VM Capacity';'for Augmented Reality App (%)'}, 'AUGMENTED_REALITY', 'percentage_for_failed');
|
||||||
plotGenericResult(1, 10, {'Failed Task due to VM Capacity';'for Health App (%)'}, 'HEALTH_APP', 'for_failed');
|
plotGenericResult(1, 10, {'Failed Task due to VM Capacity';'for Health App (%)'}, 'HEALTH_APP', 'percentage_for_failed');
|
||||||
plotGenericResult(1, 10, {'Failed Task due to VM Capacity';'for Infotainment App (%)'}, 'INFOTAINMENT_APP', 'for_failed');
|
plotGenericResult(1, 10, {'Failed Task due to VM Capacity';'for Infotainment App (%)'}, 'INFOTAINMENT_APP', 'percentage_for_failed');
|
||||||
plotGenericResult(1, 10, {'Failed Task due to VM Capacity';'for Heavy Computation App (%)'}, 'HEAVY_COMP_APP', 'for_failed');
|
plotGenericResult(1, 10, {'Failed Task due to VM Capacity';'for Heavy Computation App (%)'}, 'HEAVY_COMP_APP', 'percentage_for_failed');
|
||||||
|
|
||||||
plotGenericResult(1, 11, 'Failed Task due to Mobility (%)', 'ALL_APPS', 'percentage_for_failed');
|
plotGenericResult(1, 11, 'Failed Task due to Mobility (%)', 'ALL_APPS', 'percentage_for_failed');
|
||||||
plotGenericResult(1, 11, {'Failed Task due to Mobility';'for Augmented Reality App (%)'}, 'AUGMENTED_REALITY', 'for_failed');
|
plotGenericResult(1, 11, {'Failed Task due to Mobility';'for Augmented Reality App (%)'}, 'AUGMENTED_REALITY', 'percentage_for_failed');
|
||||||
plotGenericResult(1, 11, {'Failed Task due to Mobility';'for Health App (%)'}, 'HEALTH_APP', 'for_failed');
|
plotGenericResult(1, 11, {'Failed Task due to Mobility';'for Health App (%)'}, 'HEALTH_APP', 'percentage_for_failed');
|
||||||
plotGenericResult(1, 11, {'Failed Task due to Mobility';'for Infotainment App (%)'}, 'INFOTAINMENT_APP', 'for_failed');
|
plotGenericResult(1, 11, {'Failed Task due to Mobility';'for Infotainment App (%)'}, 'INFOTAINMENT_APP', 'percentage_for_failed');
|
||||||
plotGenericResult(1, 11, {'Failed Task due to Mobility';'for Heavy Computation App (%)'}, 'HEAVY_COMP_APP', 'for_failed');
|
plotGenericResult(1, 11, {'Failed Task due to Mobility';'for Heavy Computation App (%)'}, 'HEAVY_COMP_APP', 'percentage_for_failed');
|
||||||
|
|
||||||
plotGenericResult(1, 4, 'Failed Tasks due to Network failure (%)', 'ALL_APPS', 'percentage_for_failed');
|
plotGenericResult(1, 4, 'Failed Tasks due to Network failure (%)', 'ALL_APPS', 'percentage_for_failed');
|
||||||
plotGenericResult(1, 4, {'Failed Tasks due to Network failure';'for Augmented Reality App (%)'}, 'AUGMENTED_REALITY', 'for_failed');
|
plotGenericResult(1, 4, {'Failed Tasks due to Network failure';'for Augmented Reality App (%)'}, 'AUGMENTED_REALITY', 'percentage_for_failed');
|
||||||
plotGenericResult(1, 4, {'Failed Tasks due to Network failure';'for Health App (%)'}, 'HEALTH_APP', 'for_failed');
|
plotGenericResult(1, 4, {'Failed Tasks due to Network failure';'for Health App (%)'}, 'HEALTH_APP', 'percentage_for_failed');
|
||||||
plotGenericResult(1, 4, {'Failed Tasks due to Network failure';'for Infotainment App (%)'}, 'INFOTAINMENT_APP', 'for_failed');
|
plotGenericResult(1, 4, {'Failed Tasks due to Network failure';'for Infotainment App (%)'}, 'INFOTAINMENT_APP', 'percentage_for_failed');
|
||||||
plotGenericResult(1, 4, {'Failed Tasks due to Network failure';'for Heavy Comp. App (%)'}, 'HEAVY_COMP_APP', 'for_failed');
|
plotGenericResult(1, 4, {'Failed Tasks due to Network failure';'for Heavy Comp. App (%)'}, 'HEAVY_COMP_APP', 'percentage_for_failed');
|
||||||
end
|
end
|
@ -2,7 +2,7 @@
|
|||||||
simulation_time=33
|
simulation_time=33
|
||||||
warm_up_period=3
|
warm_up_period=3
|
||||||
vm_load_check_interval=0.1
|
vm_load_check_interval=0.1
|
||||||
vm_location_check_interval=0.1
|
location_check_interval=0.1
|
||||||
file_log_enabled=true
|
file_log_enabled=true
|
||||||
deep_file_log_enabled=false
|
deep_file_log_enabled=false
|
||||||
|
|
||||||
|
@ -1,31 +1,31 @@
|
|||||||
function [] = plotTaskFailureReason()
|
function [] = plotTaskFailureReason()
|
||||||
plotGenericResult(1, 10, 'Failed Task due to VM Capacity (%)', 'ALL_APPS', 'percentage_for_failed');
|
plotGenericResult(1, 10, 'Failed Task due to VM Capacity (%)', 'ALL_APPS', 'percentage_for_failed');
|
||||||
% plotGenericResult(1, 10, {'Failed Task due to VM Capacity';'for Augmented Reality App (%)'}, 'AUGMENTED_REALITY', 'for_failed');
|
% plotGenericResult(1, 10, {'Failed Task due to VM Capacity';'for Augmented Reality App (%)'}, 'AUGMENTED_REALITY', 'percentage_for_failed');
|
||||||
% plotGenericResult(1, 10, {'Failed Task due to VM Capacity';'for Health App (%)'}, 'HEALTH_APP', 'for_failed');
|
% plotGenericResult(1, 10, {'Failed Task due to VM Capacity';'for Health App (%)'}, 'HEALTH_APP', 'percentage_for_failed');
|
||||||
% plotGenericResult(1, 10, {'Failed Task due to VM Capacity';'for Infotainment App (%)'}, 'INFOTAINMENT_APP', 'for_failed');
|
% plotGenericResult(1, 10, {'Failed Task due to VM Capacity';'for Infotainment App (%)'}, 'INFOTAINMENT_APP', 'percentage_for_failed');
|
||||||
% plotGenericResult(1, 10, {'Failed Task due to VM Capacity';'for Heavy Computation App (%)'}, 'HEAVY_COMP_APP', 'for_failed');
|
% plotGenericResult(1, 10, {'Failed Task due to VM Capacity';'for Heavy Computation App (%)'}, 'HEAVY_COMP_APP', 'percentage_for_failed');
|
||||||
|
|
||||||
plotGenericResult(1, 11, 'Average Failed Task due to Mobility (%)', 'ALL_APPS', 'percentage_for_failed');
|
plotGenericResult(1, 11, 'Average Failed Task due to Mobility (%)', 'ALL_APPS', 'percentage_for_failed');
|
||||||
% plotGenericResult(1, 11, {'Failed Task due to VM Capacity';'for Augmented Reality App (%)'}, 'AUGMENTED_REALITY', 'for_failed');
|
% plotGenericResult(1, 11, {'Failed Task due to VM Capacity';'for Augmented Reality App (%)'}, 'AUGMENTED_REALITY', 'percentage_for_failed');
|
||||||
% plotGenericResult(1, 11, {'Failed Task due to VM Capacity';'for Health App (%)'}, 'HEALTH_APP', 'for_failed');
|
% plotGenericResult(1, 11, {'Failed Task due to VM Capacity';'for Health App (%)'}, 'HEALTH_APP', 'percentage_for_failed');
|
||||||
% plotGenericResult(1, 11, {'Failed Task due to VM Capacity';'for Infotainment App (%)'}, 'INFOTAINMENT_APP', 'for_failed');
|
% plotGenericResult(1, 11, {'Failed Task due to VM Capacity';'for Infotainment App (%)'}, 'INFOTAINMENT_APP', 'percentage_for_failed');
|
||||||
% plotGenericResult(1, 11, {'Failed Task due to VM Capacity';'for Heavy Computation App (%)'}, 'HEAVY_COMP_APP', 'for_failed');
|
% plotGenericResult(1, 11, {'Failed Task due to VM Capacity';'for Heavy Computation App (%)'}, 'HEAVY_COMP_APP', 'percentage_for_failed');
|
||||||
|
|
||||||
plotGenericResult(5, 4, 'Failed Tasks due to WLAN failure (%)', 'ALL_APPS', 'percentage_for_failed');
|
plotGenericResult(5, 4, 'Failed Tasks due to WLAN failure (%)', 'ALL_APPS', 'percentage_for_failed');
|
||||||
% plotGenericResult(5, 4, {'Failed Tasks due to WLAN';'for Augmented Reality App (%)'}, 'AUGMENTED_REALITY', 'for_failed');
|
% plotGenericResult(5, 4, {'Failed Tasks due to WLAN';'for Augmented Reality App (%)'}, 'AUGMENTED_REALITY', 'percentage_for_failed');
|
||||||
% plotGenericResult(5, 4, {'Failed Tasks due to WLAN';'for Health App (%)'}, 'HEALTH_APP', 'for_failed');
|
% plotGenericResult(5, 4, {'Failed Tasks due to WLAN';'for Health App (%)'}, 'HEALTH_APP', 'percentage_for_failed');
|
||||||
% plotGenericResult(5, 4, {'Failed Tasks due to WLAN';'for Infotainment App (%)'}, 'INFOTAINMENT_APP', 'for_failed');
|
% plotGenericResult(5, 4, {'Failed Tasks due to WLAN';'for Infotainment App (%)'}, 'INFOTAINMENT_APP', 'percentage_for_failed');
|
||||||
% plotGenericResult(5, 4, {'Failed Tasks due to WLAN';'for Heavy Comp. App (%)'}, 'HEAVY_COMP_APP', 'for_failed');
|
% plotGenericResult(5, 4, {'Failed Tasks due to WLAN';'for Heavy Comp. App (%)'}, 'HEAVY_COMP_APP', 'percentage_for_failed');
|
||||||
|
|
||||||
plotGenericResult(5, 5, 'Failed Tasks due to MAN failure (%)', 'ALL_APPS', 'percentage_for_failed');
|
plotGenericResult(5, 5, 'Failed Tasks due to MAN failure (%)', 'ALL_APPS', 'percentage_for_failed');
|
||||||
% plotGenericResult(5, 5, {'Failed Tasks due to MAN';'for Augmented Reality App (%)'}, 'AUGMENTED_REALITY', 'for_failed');
|
% plotGenericResult(5, 5, {'Failed Tasks due to MAN';'for Augmented Reality App (%)'}, 'AUGMENTED_REALITY', 'percentage_for_failed');
|
||||||
% plotGenericResult(5, 5, {'Failed Tasks due to MAN';'for Health App (%)'}, 'HEALTH_APP', 'for_failed');
|
% plotGenericResult(5, 5, {'Failed Tasks due to MAN';'for Health App (%)'}, 'HEALTH_APP', 'percentage_for_failed');
|
||||||
% plotGenericResult(5, 5, {'Failed Tasks due to MAN';'for Infotainment App (%)'}, 'INFOTAINMENT_APP', 'for_failed');
|
% plotGenericResult(5, 5, {'Failed Tasks due to MAN';'for Infotainment App (%)'}, 'INFOTAINMENT_APP', 'percentage_for_failed');
|
||||||
% plotGenericResult(5, 5, {'Failed Tasks due to MAN';'for Heavy Comp. App (%)'}, 'HEAVY_COMP_APP', 'for_failed');
|
% plotGenericResult(5, 5, {'Failed Tasks due to MAN';'for Heavy Comp. App (%)'}, 'HEAVY_COMP_APP', 'percentage_for_failed');
|
||||||
|
|
||||||
plotGenericResult(5, 6, 'Failed Tasks due to WAN failure (%)', 'ALL_APPS', 'percentage_for_failed');
|
plotGenericResult(5, 6, 'Failed Tasks due to WAN failure (%)', 'ALL_APPS', 'percentage_for_failed');
|
||||||
% plotGenericResult(5, 6, {'Failed Tasks due to WAN';'for Augmented Reality App (%)'}, 'AUGMENTED_REALITY', 'for_failed');
|
% plotGenericResult(5, 6, {'Failed Tasks due to WAN';'for Augmented Reality App (%)'}, 'AUGMENTED_REALITY', 'percentage_for_failed');
|
||||||
% plotGenericResult(5, 6, {'Failed Tasks due to WAN';'for Health App (%)'}, 'HEALTH_APP', 'for_failed');
|
% plotGenericResult(5, 6, {'Failed Tasks due to WAN';'for Health App (%)'}, 'HEALTH_APP', 'percentage_for_failed');
|
||||||
% plotGenericResult(5, 6, {'Failed Tasks due to WAN';'for Infotainment App (%)'}, 'INFOTAINMENT_APP', 'for_failed');
|
% plotGenericResult(5, 6, {'Failed Tasks due to WAN';'for Infotainment App (%)'}, 'INFOTAINMENT_APP', 'percentage_for_failed');
|
||||||
% plotGenericResult(5, 6, {'Failed Tasks due to WAN';'for Heavy Comp. App (%)'}, 'HEAVY_COMP_APP', 'for_failed');
|
% plotGenericResult(5, 6, {'Failed Tasks due to WAN';'for Heavy Comp. App (%)'}, 'HEAVY_COMP_APP', 'percentage_for_failed');
|
||||||
end
|
end
|
||||||
|
@ -298,7 +298,8 @@ public class SampleMobileDeviceManager extends MobileDeviceManager {
|
|||||||
task.setSubmittedLocation(currentLocation);
|
task.setSubmittedLocation(currentLocation);
|
||||||
|
|
||||||
//add related task to log list
|
//add related task to log list
|
||||||
SimLogger.getInstance().addLog(task.getCloudletId(),
|
SimLogger.getInstance().addLog(task.getMobileDeviceId(),
|
||||||
|
task.getCloudletId(),
|
||||||
task.getTaskType(),
|
task.getTaskType(),
|
||||||
(int)task.getCloudletLength(),
|
(int)task.getCloudletLength(),
|
||||||
(int)task.getCloudletFileSize(),
|
(int)task.getCloudletFileSize(),
|
||||||
|
@ -191,7 +191,8 @@ public class SampleMobileDeviceManager extends MobileDeviceManager {
|
|||||||
task.setSubmittedLocation(currentLocation);
|
task.setSubmittedLocation(currentLocation);
|
||||||
|
|
||||||
//add related task to log list
|
//add related task to log list
|
||||||
SimLogger.getInstance().addLog(task.getCloudletId(),
|
SimLogger.getInstance().addLog(task.getMobileDeviceId(),
|
||||||
|
task.getCloudletId(),
|
||||||
task.getTaskType(),
|
task.getTaskType(),
|
||||||
(int)task.getCloudletLength(),
|
(int)task.getCloudletLength(),
|
||||||
(int)task.getCloudletFileSize(),
|
(int)task.getCloudletFileSize(),
|
||||||
|
@ -166,7 +166,7 @@ public class SampleMobileServerManager extends MobileServerManager{
|
|||||||
//4. Create Hosts with its id and list of PEs and add them to the list of machines
|
//4. Create Hosts with its id and list of PEs and add them to the list of machines
|
||||||
MobileHost host = new MobileHost(
|
MobileHost host = new MobileHost(
|
||||||
//Hosts should have unique IDs, so create Mobile Hosts after Edge+Cloud Hosts
|
//Hosts should have unique IDs, so create Mobile Hosts after Edge+Cloud Hosts
|
||||||
i+SimSettings.getInstance().getNumOfEdgeHosts()+SimSettings.getInstance().getNumOfCouldHost(),
|
i+SimSettings.getInstance().getNumOfEdgeHosts()+SimSettings.getInstance().getNumOfCloudHost(),
|
||||||
new RamProvisionerSimple(ram),
|
new RamProvisionerSimple(ram),
|
||||||
new BwProvisionerSimple(bandwidth), //kbps
|
new BwProvisionerSimple(bandwidth), //kbps
|
||||||
storage,
|
storage,
|
||||||
|
@ -357,7 +357,7 @@ public class FuzzyExperimentalNetworkModel extends NetworkModel {
|
|||||||
return getWanDownloadDelay(accessPointLocation, dataSize);
|
return getWanDownloadDelay(accessPointLocation, dataSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
private double calculateMM1(double propogationDelay, double bandwidth /*Kbps*/, double PoissonMean, double avgTaskSize /*KB*/, int deviceCount){
|
private double calculateMM1(double propagationDelay, double bandwidth /*Kbps*/, double PoissonMean, double avgTaskSize /*KB*/, int deviceCount){
|
||||||
double mu=0, lamda=0;
|
double mu=0, lamda=0;
|
||||||
|
|
||||||
avgTaskSize = avgTaskSize * 8; //convert from KB to Kb
|
avgTaskSize = avgTaskSize * 8; //convert from KB to Kb
|
||||||
@ -369,7 +369,7 @@ public class FuzzyExperimentalNetworkModel extends NetworkModel {
|
|||||||
if(result < 0)
|
if(result < 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
result += propogationDelay;
|
result += propagationDelay;
|
||||||
|
|
||||||
return (result > 15) ? 0 : result;
|
return (result > 15) ? 0 : result;
|
||||||
}
|
}
|
||||||
|
@ -286,7 +286,8 @@ public class FuzzyMobileDeviceManager extends MobileDeviceManager {
|
|||||||
task.setSubmittedLocation(currentLocation);
|
task.setSubmittedLocation(currentLocation);
|
||||||
|
|
||||||
//add related task to log list
|
//add related task to log list
|
||||||
SimLogger.getInstance().addLog(task.getCloudletId(),
|
SimLogger.getInstance().addLog(task.getMobileDeviceId(),
|
||||||
|
task.getCloudletId(),
|
||||||
task.getTaskType(),
|
task.getTaskType(),
|
||||||
(int)task.getCloudletLength(),
|
(int)task.getCloudletLength(),
|
||||||
(int)task.getCloudletFileSize(),
|
(int)task.getCloudletFileSize(),
|
||||||
|
@ -32,11 +32,11 @@ public class CloudVM extends Vm {
|
|||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* dynamically reconfigures the mips value of a VM in CloudSim
|
* dynamically reconfigures the mips value of a VM in CloudSim
|
||||||
*
|
*
|
||||||
* @param mips new mips value for this VM.
|
* @param mips new mips value for this VM.
|
||||||
*/
|
*/
|
||||||
public void reconfigureMips(double mips){
|
public void reconfigureMips(double mips){
|
||||||
super.setMips(mips);
|
super.setMips(mips);
|
||||||
super.getHost().getVmScheduler().deallocatePesForVm(this);
|
super.getHost().getVmScheduler().deallocatePesForVm(this);
|
||||||
|
@ -67,7 +67,7 @@ public class CloudVmAllocationPolicy_Custom extends VmAllocationPolicy {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean allocateHostForVm(Vm vm, Host host) {
|
public boolean allocateHostForVm(Vm vm, Host host) {
|
||||||
if (host.vmCreate(vm)) { // if vm has been succesfully created in the host
|
if (host.vmCreate(vm)) { // if vm has been successfully created in the host
|
||||||
getVmTable().put(vm.getUid(), host);
|
getVmTable().put(vm.getUid(), host);
|
||||||
createdVmNum++;
|
createdVmNum++;
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ public class DefaultCloudServerManager extends CloudServerManager{
|
|||||||
int vmCounter=SimSettings.getInstance().getNumOfEdgeVMs();
|
int vmCounter=SimSettings.getInstance().getNumOfEdgeVMs();
|
||||||
|
|
||||||
//Create VMs for each hosts
|
//Create VMs for each hosts
|
||||||
for (int i = 0; i < SimSettings.getInstance().getNumOfCouldHost(); i++) {
|
for (int i = 0; i < SimSettings.getInstance().getNumOfCloudHost(); i++) {
|
||||||
vmList.add(i, new ArrayList<CloudVM>());
|
vmList.add(i, new ArrayList<CloudVM>());
|
||||||
for(int j = 0; j < SimSettings.getInstance().getNumOfCloudVMsPerHost(); j++){
|
for(int j = 0; j < SimSettings.getInstance().getNumOfCloudVMsPerHost(); j++){
|
||||||
String vmm = "Xen";
|
String vmm = "Xen";
|
||||||
@ -131,7 +131,7 @@ public class DefaultCloudServerManager extends CloudServerManager{
|
|||||||
// 1. We need to create a list to store one or more Machines
|
// 1. We need to create a list to store one or more Machines
|
||||||
List<Host> hostList = new ArrayList<Host>();
|
List<Host> hostList = new ArrayList<Host>();
|
||||||
|
|
||||||
for (int i = 0; i < SimSettings.getInstance().getNumOfCouldHost(); i++) {
|
for (int i = 0; i < SimSettings.getInstance().getNumOfCloudHost(); i++) {
|
||||||
int numOfVMPerHost = SimSettings.getInstance().getNumOfCloudVMsPerHost();
|
int numOfVMPerHost = SimSettings.getInstance().getNumOfCloudVMsPerHost();
|
||||||
int numOfCores = SimSettings.getInstance().getCoreForCloudVM() * numOfVMPerHost;
|
int numOfCores = SimSettings.getInstance().getCoreForCloudVM() * numOfVMPerHost;
|
||||||
double mips = SimSettings.getInstance().getMipsForCloudVM() * numOfVMPerHost;
|
double mips = SimSettings.getInstance().getMipsForCloudVM() * numOfVMPerHost;
|
||||||
|
@ -16,7 +16,6 @@ import java.io.IOException;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.cloudbus.cloudsim.Host;
|
import org.cloudbus.cloudsim.Host;
|
||||||
import org.cloudbus.cloudsim.Log;
|
|
||||||
import org.cloudbus.cloudsim.core.CloudSim;
|
import org.cloudbus.cloudsim.core.CloudSim;
|
||||||
import org.cloudbus.cloudsim.core.SimEntity;
|
import org.cloudbus.cloudsim.core.SimEntity;
|
||||||
import org.cloudbus.cloudsim.core.SimEvent;
|
import org.cloudbus.cloudsim.core.SimEvent;
|
||||||
@ -185,7 +184,7 @@ public class SimManager extends SimEntity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int i = 0; i<SimSettings.getInstance().getNumOfCouldHost(); i++) {
|
for(int i = 0; i<SimSettings.getInstance().getNumOfCloudHost(); i++) {
|
||||||
mobileDeviceManager.submitVmList(cloudServerManager.getVmList(i));
|
mobileDeviceManager.submitVmList(cloudServerManager.getVmList(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -217,14 +216,14 @@ public class SimManager extends SimEntity {
|
|||||||
mobileDeviceManager.submitTask(edgeTask);
|
mobileDeviceManager.submitTask(edgeTask);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
System.exit(0);
|
System.exit(1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CHECK_ALL_VM:
|
case CHECK_ALL_VM:
|
||||||
int totalNumOfVm = SimSettings.getInstance().getNumOfEdgeVMs();
|
int totalNumOfVm = SimSettings.getInstance().getNumOfEdgeVMs();
|
||||||
if(EdgeVmAllocationPolicy_Custom.getCreatedVmNum() != totalNumOfVm){
|
if(EdgeVmAllocationPolicy_Custom.getCreatedVmNum() != totalNumOfVm){
|
||||||
SimLogger.printLine("All VMs cannot be created! Terminating simulation...");
|
SimLogger.printLine("All VMs cannot be created! Terminating simulation...");
|
||||||
System.exit(0);
|
System.exit(1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GET_LOAD_LOG:
|
case GET_LOAD_LOG:
|
||||||
@ -253,11 +252,11 @@ public class SimManager extends SimEntity {
|
|||||||
SimLogger.getInstance().simStopped();
|
SimLogger.getInstance().simStopped();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
System.exit(0);
|
System.exit(1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Log.printLine(getName() + ": unknown event type");
|
SimLogger.printLine(getName() + ": unknown event type");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ public class SimSettings {
|
|||||||
public static enum VM_TYPES { MOBILE_VM, EDGE_VM, CLOUD_VM }
|
public static enum VM_TYPES { MOBILE_VM, EDGE_VM, CLOUD_VM }
|
||||||
|
|
||||||
//enumarations for the VM types
|
//enumarations for the VM types
|
||||||
public static enum NETWORK_DELAY_TYPES { WLAN_DELAY, MAN_DELAY, WAN_DELAY }
|
public static enum NETWORK_DELAY_TYPES { WLAN_DELAY, MAN_DELAY, WAN_DELAY, GSM_DELAY }
|
||||||
|
|
||||||
//predifined IDs for the components.
|
//predifined IDs for the components.
|
||||||
public static final int CLOUD_DATACENTER_ID = 1000;
|
public static final int CLOUD_DATACENTER_ID = 1000;
|
||||||
@ -50,63 +50,72 @@ public class SimSettings {
|
|||||||
//delimiter for output file.
|
//delimiter for output file.
|
||||||
public static final String DELIMITER = ";";
|
public static final String DELIMITER = ";";
|
||||||
|
|
||||||
private double SIMULATION_TIME; //minutes unit in properties file
|
private double SIMULATION_TIME; //minutes unit in properties file
|
||||||
private double WARM_UP_PERIOD; //minutes unit in properties file
|
private double WARM_UP_PERIOD; //minutes unit in properties file
|
||||||
private double INTERVAL_TO_GET_VM_LOAD_LOG; //minutes unit in properties file
|
private double INTERVAL_TO_GET_VM_LOAD_LOG; //minutes unit in properties file
|
||||||
private double INTERVAL_TO_GET_VM_LOCATION_LOG; //minutes unit in properties file
|
private double INTERVAL_TO_GET_LOCATION_LOG; //minutes unit in properties file
|
||||||
private boolean FILE_LOG_ENABLED; //boolean to check file logging option
|
private double INTERVAL_TO_GET_AP_DELAY_LOG; //minutes unit in properties file
|
||||||
private boolean DEEP_FILE_LOG_ENABLED; //boolean to check deep file logging option
|
private boolean FILE_LOG_ENABLED; //boolean to check file logging option
|
||||||
|
private boolean DEEP_FILE_LOG_ENABLED; //boolean to check deep file logging option
|
||||||
|
|
||||||
private int MIN_NUM_OF_MOBILE_DEVICES;
|
private int MIN_NUM_OF_MOBILE_DEVICES;
|
||||||
private int MAX_NUM_OF_MOBILE_DEVICES;
|
private int MAX_NUM_OF_MOBILE_DEVICES;
|
||||||
private int MOBILE_DEVICE_COUNTER_SIZE;
|
private int MOBILE_DEVICE_COUNTER_SIZE;
|
||||||
|
private int WLAN_RANGE;
|
||||||
|
|
||||||
private int NUM_OF_EDGE_DATACENTERS;
|
private int NUM_OF_EDGE_DATACENTERS;
|
||||||
private int NUM_OF_EDGE_HOSTS;
|
private int NUM_OF_EDGE_HOSTS;
|
||||||
private int NUM_OF_EDGE_VMS;
|
private int NUM_OF_EDGE_VMS;
|
||||||
private int NUM_OF_PLACE_TYPES;
|
private int NUM_OF_PLACE_TYPES;
|
||||||
|
|
||||||
private double WAN_PROPOGATION_DELAY; //seconds unit in properties file
|
private double WAN_PROPAGATION_DELAY; //seconds unit in properties file
|
||||||
private double LAN_INTERNAL_DELAY; //seconds unit in properties file
|
private double GSM_PROPAGATION_DELAY; //seconds unit in properties file
|
||||||
private int BANDWITH_WLAN; //Mbps unit in properties file
|
private double LAN_INTERNAL_DELAY; //seconds unit in properties file
|
||||||
private int BANDWITH_WAN; //Mbps unit in properties file
|
private int BANDWITH_WLAN; //Mbps unit in properties file
|
||||||
private int BANDWITH_GSM; //Mbps unit in properties file
|
private int BANDWITH_MAN; //Mbps unit in properties file
|
||||||
|
private int BANDWITH_WAN; //Mbps unit in properties file
|
||||||
|
private int BANDWITH_GSM; //Mbps unit in properties file
|
||||||
|
|
||||||
private int NUM_OF_HOST_ON_CLOUD_DATACENTER;
|
private int NUM_OF_HOST_ON_CLOUD_DATACENTER;
|
||||||
private int NUM_OF_VM_ON_CLOUD_HOST;
|
private int NUM_OF_VM_ON_CLOUD_HOST;
|
||||||
private int CORE_FOR_CLOUD_VM;
|
private int CORE_FOR_CLOUD_VM;
|
||||||
private int MIPS_FOR_CLOUD_VM; //MIPS
|
private int MIPS_FOR_CLOUD_VM; //MIPS
|
||||||
private int RAM_FOR_CLOUD_VM; //MB
|
private int RAM_FOR_CLOUD_VM; //MB
|
||||||
private int STORAGE_FOR_CLOUD_VM; //Byte
|
private int STORAGE_FOR_CLOUD_VM; //Byte
|
||||||
|
|
||||||
private int CORE_FOR_VM;
|
private int CORE_FOR_VM;
|
||||||
private int MIPS_FOR_VM; //MIPS
|
private int MIPS_FOR_VM; //MIPS
|
||||||
private int RAM_FOR_VM; //MB
|
private int RAM_FOR_VM; //MB
|
||||||
private int STORAGE_FOR_VM; //Byte
|
private int STORAGE_FOR_VM; //Byte
|
||||||
|
|
||||||
private String[] SIMULATION_SCENARIOS;
|
private String[] SIMULATION_SCENARIOS;
|
||||||
private String[] ORCHESTRATOR_POLICIES;
|
private String[] ORCHESTRATOR_POLICIES;
|
||||||
|
|
||||||
// mean waiting time (minute) is stored for each place types
|
private double NORTHERN_BOUND;
|
||||||
private double[] mobilityLookUpTable;
|
private double EASTERN_BOUND;
|
||||||
|
private double SOUTHERN_BOUND;
|
||||||
|
private double WESTERN_BOUND;
|
||||||
|
|
||||||
// following values are stored for each applications defined in applications.xml
|
// mean waiting time (minute) is stored for each place types
|
||||||
// [0] usage percentage (%)
|
private double[] mobilityLookUpTable;
|
||||||
// [1] prob. of selecting cloud (%)
|
|
||||||
// [2] poisson mean (sec)
|
|
||||||
// [3] active period (sec)
|
|
||||||
// [4] idle period (sec)
|
|
||||||
// [5] avg data upload (KB)
|
|
||||||
// [6] avg data download (KB)
|
|
||||||
// [7] avg task length (MI)
|
|
||||||
// [8] required # of cores
|
|
||||||
// [9] vm utilization on edge (%)
|
|
||||||
// [10] vm utilization on cloud (%)
|
|
||||||
// [11] vm utilization on mobile (%)
|
|
||||||
// [12] delay sensitivity [0-1]
|
|
||||||
private double[][] taskLookUpTable = null;
|
|
||||||
|
|
||||||
private String[] taskNames = null;
|
// following values are stored for each applications defined in applications.xml
|
||||||
|
// [0] usage percentage (%)
|
||||||
|
// [1] prob. of selecting cloud (%)
|
||||||
|
// [2] poisson mean (sec)
|
||||||
|
// [3] active period (sec)
|
||||||
|
// [4] idle period (sec)
|
||||||
|
// [5] avg data upload (KB)
|
||||||
|
// [6] avg data download (KB)
|
||||||
|
// [7] avg task length (MI)
|
||||||
|
// [8] required # of cores
|
||||||
|
// [9] vm utilization on edge (%)
|
||||||
|
// [10] vm utilization on cloud (%)
|
||||||
|
// [11] vm utilization on mobile (%)
|
||||||
|
// [12] delay sensitivity [0-1]
|
||||||
|
private double[][] taskLookUpTable = null;
|
||||||
|
|
||||||
|
private String[] taskNames = null;
|
||||||
|
|
||||||
private SimSettings() {
|
private SimSettings() {
|
||||||
NUM_OF_PLACE_TYPES = 0;
|
NUM_OF_PLACE_TYPES = 0;
|
||||||
@ -137,25 +146,29 @@ public class SimSettings {
|
|||||||
SIMULATION_TIME = (double)60 * Double.parseDouble(prop.getProperty("simulation_time")); //seconds
|
SIMULATION_TIME = (double)60 * Double.parseDouble(prop.getProperty("simulation_time")); //seconds
|
||||||
WARM_UP_PERIOD = (double)60 * Double.parseDouble(prop.getProperty("warm_up_period")); //seconds
|
WARM_UP_PERIOD = (double)60 * Double.parseDouble(prop.getProperty("warm_up_period")); //seconds
|
||||||
INTERVAL_TO_GET_VM_LOAD_LOG = (double)60 * Double.parseDouble(prop.getProperty("vm_load_check_interval")); //seconds
|
INTERVAL_TO_GET_VM_LOAD_LOG = (double)60 * Double.parseDouble(prop.getProperty("vm_load_check_interval")); //seconds
|
||||||
INTERVAL_TO_GET_VM_LOCATION_LOG = (double)60 * Double.parseDouble(prop.getProperty("vm_location_check_interval")); //seconds
|
INTERVAL_TO_GET_LOCATION_LOG = (double)60 * Double.parseDouble(prop.getProperty("location_check_interval")); //seconds
|
||||||
|
INTERVAL_TO_GET_AP_DELAY_LOG = (double)60 * Double.parseDouble(prop.getProperty("ap_delay_check_interval", "0")); //seconds
|
||||||
FILE_LOG_ENABLED = Boolean.parseBoolean(prop.getProperty("file_log_enabled"));
|
FILE_LOG_ENABLED = Boolean.parseBoolean(prop.getProperty("file_log_enabled"));
|
||||||
DEEP_FILE_LOG_ENABLED = Boolean.parseBoolean(prop.getProperty("deep_file_log_enabled"));
|
DEEP_FILE_LOG_ENABLED = Boolean.parseBoolean(prop.getProperty("deep_file_log_enabled"));
|
||||||
|
|
||||||
MIN_NUM_OF_MOBILE_DEVICES = Integer.parseInt(prop.getProperty("min_number_of_mobile_devices"));
|
MIN_NUM_OF_MOBILE_DEVICES = Integer.parseInt(prop.getProperty("min_number_of_mobile_devices"));
|
||||||
MAX_NUM_OF_MOBILE_DEVICES = Integer.parseInt(prop.getProperty("max_number_of_mobile_devices"));
|
MAX_NUM_OF_MOBILE_DEVICES = Integer.parseInt(prop.getProperty("max_number_of_mobile_devices"));
|
||||||
MOBILE_DEVICE_COUNTER_SIZE = Integer.parseInt(prop.getProperty("mobile_device_counter_size"));
|
MOBILE_DEVICE_COUNTER_SIZE = Integer.parseInt(prop.getProperty("mobile_device_counter_size"));
|
||||||
|
WLAN_RANGE = Integer.parseInt(prop.getProperty("wlan_range", "0"));
|
||||||
|
|
||||||
WAN_PROPOGATION_DELAY = Double.parseDouble(prop.getProperty("wan_propagation_delay"));
|
WAN_PROPAGATION_DELAY = Double.parseDouble(prop.getProperty("wan_propagation_delay", "0"));
|
||||||
LAN_INTERNAL_DELAY = Double.parseDouble(prop.getProperty("lan_internal_delay"));
|
GSM_PROPAGATION_DELAY = Double.parseDouble(prop.getProperty("gsm_propagation_delay", "0"));
|
||||||
|
LAN_INTERNAL_DELAY = Double.parseDouble(prop.getProperty("lan_internal_delay", "0"));
|
||||||
BANDWITH_WLAN = 1000 * Integer.parseInt(prop.getProperty("wlan_bandwidth"));
|
BANDWITH_WLAN = 1000 * Integer.parseInt(prop.getProperty("wlan_bandwidth"));
|
||||||
BANDWITH_WAN = 1000 * Integer.parseInt(prop.getProperty("wan_bandwidth"));
|
BANDWITH_MAN = 1000 * Integer.parseInt(prop.getProperty("man_bandwidth", "0"));
|
||||||
BANDWITH_GSM = 1000 * Integer.parseInt(prop.getProperty("gsm_bandwidth"));
|
BANDWITH_WAN = 1000 * Integer.parseInt(prop.getProperty("wan_bandwidth", "0"));
|
||||||
|
BANDWITH_GSM = 1000 * Integer.parseInt(prop.getProperty("gsm_bandwidth", "0"));
|
||||||
|
|
||||||
NUM_OF_HOST_ON_CLOUD_DATACENTER = Integer.parseInt(prop.getProperty("number_of_host_on_cloud_datacenter"));
|
NUM_OF_HOST_ON_CLOUD_DATACENTER = Integer.parseInt(prop.getProperty("number_of_host_on_cloud_datacenter"));
|
||||||
NUM_OF_VM_ON_CLOUD_HOST = Integer.parseInt(prop.getProperty("number_of_vm_on_cloud_host"));
|
NUM_OF_VM_ON_CLOUD_HOST = Integer.parseInt(prop.getProperty("number_of_vm_on_cloud_host"));
|
||||||
CORE_FOR_CLOUD_VM = Integer.parseInt(prop.getProperty("core_for_cloud_vm"));
|
CORE_FOR_CLOUD_VM = Integer.parseInt(prop.getProperty("core_for_cloud_vm"));
|
||||||
MIPS_FOR_CLOUD_VM = Integer.parseInt(prop.getProperty("mips_for_cloud_vm"));
|
MIPS_FOR_CLOUD_VM = Integer.parseInt(prop.getProperty("mips_for_cloud_vm"));
|
||||||
RAM_FOR_CLOUD_VM = Integer.parseInt(prop.getProperty("ram_for_cloud_vm"));
|
RAM_FOR_CLOUD_VM = Integer.parseInt(prop.getProperty("ram_for_cloud_vm"));
|
||||||
STORAGE_FOR_CLOUD_VM = Integer.parseInt(prop.getProperty("storage_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"));
|
RAM_FOR_VM = Integer.parseInt(prop.getProperty("ram_for_mobile_vm"));
|
||||||
@ -167,6 +180,11 @@ public class SimSettings {
|
|||||||
|
|
||||||
SIMULATION_SCENARIOS = prop.getProperty("simulation_scenarios").split(",");
|
SIMULATION_SCENARIOS = prop.getProperty("simulation_scenarios").split(",");
|
||||||
|
|
||||||
|
NORTHERN_BOUND = Double.parseDouble(prop.getProperty("northern_bound", "0"));
|
||||||
|
SOUTHERN_BOUND = Double.parseDouble(prop.getProperty("southern_bound", "0"));
|
||||||
|
EASTERN_BOUND = Double.parseDouble(prop.getProperty("eastern_bound", "0"));
|
||||||
|
WESTERN_BOUND = Double.parseDouble(prop.getProperty("western_bound", "0"));
|
||||||
|
|
||||||
//avg waiting time in a place (min)
|
//avg waiting time in a place (min)
|
||||||
double place1_mean_waiting_time = Double.parseDouble(prop.getProperty("attractiveness_L1_mean_waiting_time"));
|
double place1_mean_waiting_time = Double.parseDouble(prop.getProperty("attractiveness_L1_mean_waiting_time"));
|
||||||
double place2_mean_waiting_time = Double.parseDouble(prop.getProperty("attractiveness_L2_mean_waiting_time"));
|
double place2_mean_waiting_time = Double.parseDouble(prop.getProperty("attractiveness_L2_mean_waiting_time"));
|
||||||
@ -174,10 +192,10 @@ public class SimSettings {
|
|||||||
|
|
||||||
//mean waiting time (minute)
|
//mean waiting time (minute)
|
||||||
mobilityLookUpTable = new double[]{
|
mobilityLookUpTable = new double[]{
|
||||||
place1_mean_waiting_time, //ATTRACTIVENESS_L1
|
place1_mean_waiting_time, //ATTRACTIVENESS_L1
|
||||||
place2_mean_waiting_time, //ATTRACTIVENESS_L2
|
place2_mean_waiting_time, //ATTRACTIVENESS_L2
|
||||||
place3_mean_waiting_time //ATTRACTIVENESS_L3
|
place3_mean_waiting_time //ATTRACTIVENESS_L3
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
@ -233,9 +251,17 @@ public class SimSettings {
|
|||||||
/**
|
/**
|
||||||
* returns VM location log collection interval (in seconds unit) from properties file
|
* returns VM location log collection interval (in seconds unit) from properties file
|
||||||
*/
|
*/
|
||||||
public double getVmLocationLogInterval()
|
public double getLocationLogInterval()
|
||||||
{
|
{
|
||||||
return INTERVAL_TO_GET_VM_LOCATION_LOG;
|
return INTERVAL_TO_GET_LOCATION_LOG;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* returns VM location log collection interval (in seconds unit) from properties file
|
||||||
|
*/
|
||||||
|
public double getApDelayLogInterval()
|
||||||
|
{
|
||||||
|
return INTERVAL_TO_GET_AP_DELAY_LOG;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -243,7 +269,7 @@ public class SimSettings {
|
|||||||
*/
|
*/
|
||||||
public boolean getDeepFileLoggingEnabled()
|
public boolean getDeepFileLoggingEnabled()
|
||||||
{
|
{
|
||||||
return DEEP_FILE_LOG_ENABLED;
|
return FILE_LOG_ENABLED && DEEP_FILE_LOG_ENABLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -259,7 +285,15 @@ public class SimSettings {
|
|||||||
*/
|
*/
|
||||||
public double getWanPropagationDelay()
|
public double getWanPropagationDelay()
|
||||||
{
|
{
|
||||||
return WAN_PROPOGATION_DELAY;
|
return WAN_PROPAGATION_DELAY;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* returns GSM propagation delay (in second unit) from properties file
|
||||||
|
*/
|
||||||
|
public double getGsmPropagationDelay()
|
||||||
|
{
|
||||||
|
return GSM_PROPAGATION_DELAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -278,6 +312,14 @@ public class SimSettings {
|
|||||||
return BANDWITH_WLAN;
|
return BANDWITH_WLAN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* returns MAN bandwidth (in Mbps unit) from properties file
|
||||||
|
*/
|
||||||
|
public int getManBandwidth()
|
||||||
|
{
|
||||||
|
return BANDWITH_MAN;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns WAN bandwidth (in Mbps unit) from properties file
|
* returns WAN bandwidth (in Mbps unit) from properties file
|
||||||
*/
|
*/
|
||||||
@ -319,6 +361,14 @@ public class SimSettings {
|
|||||||
return MOBILE_DEVICE_COUNTER_SIZE;
|
return MOBILE_DEVICE_COUNTER_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* returns edge device range in meter
|
||||||
|
*/
|
||||||
|
public int getWlanRange()
|
||||||
|
{
|
||||||
|
return WLAN_RANGE;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns the number of edge datacenters
|
* returns the number of edge datacenters
|
||||||
*/
|
*/
|
||||||
@ -354,7 +404,7 @@ public class SimSettings {
|
|||||||
/**
|
/**
|
||||||
* returns the number of cloud datacenters
|
* returns the number of cloud datacenters
|
||||||
*/
|
*/
|
||||||
public int getNumOfCouldHost()
|
public int getNumOfCloudHost()
|
||||||
{
|
{
|
||||||
return NUM_OF_HOST_ON_CLOUD_DATACENTER;
|
return NUM_OF_HOST_ON_CLOUD_DATACENTER;
|
||||||
}
|
}
|
||||||
@ -440,7 +490,7 @@ public class SimSettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns simulation scenarios as string
|
* returns simulation screnarios as string
|
||||||
*/
|
*/
|
||||||
public String[] getSimulationScenarios()
|
public String[] getSimulationScenarios()
|
||||||
{
|
{
|
||||||
@ -455,6 +505,23 @@ public class SimSettings {
|
|||||||
return ORCHESTRATOR_POLICIES;
|
return ORCHESTRATOR_POLICIES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public double getNorthernBound() {
|
||||||
|
return NORTHERN_BOUND;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getEasternBound() {
|
||||||
|
return EASTERN_BOUND;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getSouthernBound() {
|
||||||
|
return SOUTHERN_BOUND;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getWesternBound() {
|
||||||
|
return WESTERN_BOUND;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns mobility characteristic within an array
|
* returns mobility characteristic within an array
|
||||||
* the result includes mean waiting time (minute) or each place type
|
* the result includes mean waiting time (minute) or each place type
|
||||||
@ -480,35 +547,66 @@ public class SimSettings {
|
|||||||
* [10] vm utilization on cloud (%)
|
* [10] vm utilization on cloud (%)
|
||||||
* [11] vm utilization on mobile (%)
|
* [11] vm utilization on mobile (%)
|
||||||
* [12] delay sensitivity [0-1]
|
* [12] delay sensitivity [0-1]
|
||||||
|
* [13] maximum delay requirement (sec)
|
||||||
*/
|
*/
|
||||||
public double[][] getTaskLookUpTable()
|
public double[][] getTaskLookUpTable()
|
||||||
{
|
{
|
||||||
return taskLookUpTable;
|
return taskLookUpTable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public double[] getTaskProperties(String taskName) {
|
||||||
|
double[] result = null;
|
||||||
|
int index = -1;
|
||||||
|
for (int i=0;i<taskNames.length;i++) {
|
||||||
|
if (taskNames[i].equals(taskName)) {
|
||||||
|
index = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(index >= 0 && index < taskLookUpTable.length)
|
||||||
|
result = taskLookUpTable[index];
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
public String getTaskName(int taskType)
|
public String getTaskName(int taskType)
|
||||||
{
|
{
|
||||||
return taskNames[taskType];
|
return taskNames[taskType];
|
||||||
}
|
}
|
||||||
|
|
||||||
private void isAttributePresent(Element element, String key) {
|
private void isAttributePresent(Element element, String key) {
|
||||||
String value = element.getAttribute(key);
|
String value = element.getAttribute(key);
|
||||||
if (value.isEmpty() || value == null){
|
if (value.isEmpty() || value == null){
|
||||||
throw new IllegalArgumentException("Attribute '" + key + "' is not found in '" + element.getNodeName() +"'");
|
throw new IllegalArgumentException("Attribute '" + key + "' is not found in '" + element.getNodeName() +"'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void isElementPresent(Element element, String key) {
|
private void isElementPresent(Element element, String key) {
|
||||||
try {
|
try {
|
||||||
String value = element.getElementsByTagName(key).item(0).getTextContent();
|
String value = element.getElementsByTagName(key).item(0).getTextContent();
|
||||||
if (value.isEmpty() || value == null){
|
if (value.isEmpty() || value == null){
|
||||||
throw new IllegalArgumentException("Element '" + key + "' is not found in '" + element.getNodeName() +"'");
|
throw new IllegalArgumentException("Element '" + key + "' is not found in '" + element.getNodeName() +"'");
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new IllegalArgumentException("Element '" + key + "' is not found in '" + element.getNodeName() +"'");
|
throw new IllegalArgumentException("Element '" + key + "' is not found in '" + element.getNodeName() +"'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Boolean checkElement(Element element, String key) {
|
||||||
|
Boolean result = true;
|
||||||
|
try {
|
||||||
|
String value = element.getElementsByTagName(key).item(0).getTextContent();
|
||||||
|
if (value.isEmpty() || value == null){
|
||||||
|
result = false;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
result = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
private void parseApplicationsXML(String filePath)
|
private void parseApplicationsXML(String filePath)
|
||||||
{
|
{
|
||||||
Document doc = null;
|
Document doc = null;
|
||||||
@ -519,64 +617,55 @@ public class SimSettings {
|
|||||||
doc = dBuilder.parse(devicesFile);
|
doc = dBuilder.parse(devicesFile);
|
||||||
doc.getDocumentElement().normalize();
|
doc.getDocumentElement().normalize();
|
||||||
|
|
||||||
|
String mandatoryAttributes[] = {
|
||||||
|
"usage_percentage", //usage percentage [0-100]
|
||||||
|
"prob_cloud_selection", //prob. of selecting cloud [0-100]
|
||||||
|
"poisson_interarrival", //poisson mean (sec)
|
||||||
|
"active_period", //active period (sec)
|
||||||
|
"idle_period", //idle period (sec)
|
||||||
|
"data_upload", //avg data upload (KB)
|
||||||
|
"data_download", //avg data download (KB)
|
||||||
|
"task_length", //avg task length (MI)
|
||||||
|
"required_core", //required # of core
|
||||||
|
"vm_utilization_on_edge", //vm utilization on edge vm [0-100]
|
||||||
|
"vm_utilization_on_cloud", //vm utilization on cloud vm [0-100]
|
||||||
|
"vm_utilization_on_mobile", //vm utilization on mobile vm [0-100]
|
||||||
|
"delay_sensitivity"}; //delay_sensitivity [0-1]
|
||||||
|
|
||||||
|
String optionalAttributes[] = {
|
||||||
|
"max_delay_requirement"}; //maximum delay requirement (sec)
|
||||||
|
|
||||||
NodeList appList = doc.getElementsByTagName("application");
|
NodeList appList = doc.getElementsByTagName("application");
|
||||||
taskLookUpTable = new double[appList.getLength()][13];
|
taskLookUpTable = new double[appList.getLength()]
|
||||||
|
[mandatoryAttributes.length + optionalAttributes.length];
|
||||||
|
|
||||||
taskNames = new String[appList.getLength()];
|
taskNames = new String[appList.getLength()];
|
||||||
for (int i = 0; i < appList.getLength(); i++) {
|
for (int i = 0; i < appList.getLength(); i++) {
|
||||||
Node appNode = appList.item(i);
|
Node appNode = appList.item(i);
|
||||||
|
|
||||||
Element appElement = (Element) appNode;
|
Element appElement = (Element) appNode;
|
||||||
isAttributePresent(appElement, "name");
|
isAttributePresent(appElement, "name");
|
||||||
isElementPresent(appElement, "usage_percentage");
|
|
||||||
isElementPresent(appElement, "prob_cloud_selection");
|
|
||||||
isElementPresent(appElement, "poisson_interarrival");
|
|
||||||
isElementPresent(appElement, "active_period");
|
|
||||||
isElementPresent(appElement, "idle_period");
|
|
||||||
isElementPresent(appElement, "data_upload");
|
|
||||||
isElementPresent(appElement, "data_download");
|
|
||||||
isElementPresent(appElement, "task_length");
|
|
||||||
isElementPresent(appElement, "required_core");
|
|
||||||
isElementPresent(appElement, "vm_utilization_on_edge");
|
|
||||||
isElementPresent(appElement, "vm_utilization_on_cloud");
|
|
||||||
isElementPresent(appElement, "vm_utilization_on_mobile");
|
|
||||||
isElementPresent(appElement, "delay_sensitivity");
|
|
||||||
|
|
||||||
String taskName = appElement.getAttribute("name");
|
String taskName = appElement.getAttribute("name");
|
||||||
taskNames[i] = taskName;
|
taskNames[i] = taskName;
|
||||||
|
|
||||||
double usage_percentage = Double.parseDouble(appElement.getElementsByTagName("usage_percentage").item(0).getTextContent());
|
for(int m=0; m<mandatoryAttributes.length; m++){
|
||||||
double prob_cloud_selection = Double.parseDouble(appElement.getElementsByTagName("prob_cloud_selection").item(0).getTextContent());
|
isElementPresent(appElement, mandatoryAttributes[m]);
|
||||||
double poisson_interarrival = Double.parseDouble(appElement.getElementsByTagName("poisson_interarrival").item(0).getTextContent());
|
taskLookUpTable[i][m] = Double.parseDouble(appElement.
|
||||||
double active_period = Double.parseDouble(appElement.getElementsByTagName("active_period").item(0).getTextContent());
|
getElementsByTagName(mandatoryAttributes[m]).item(0).getTextContent());
|
||||||
double idle_period = Double.parseDouble(appElement.getElementsByTagName("idle_period").item(0).getTextContent());
|
}
|
||||||
double data_upload = Double.parseDouble(appElement.getElementsByTagName("data_upload").item(0).getTextContent());
|
|
||||||
double data_download = Double.parseDouble(appElement.getElementsByTagName("data_download").item(0).getTextContent());
|
|
||||||
double task_length = Double.parseDouble(appElement.getElementsByTagName("task_length").item(0).getTextContent());
|
|
||||||
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());
|
|
||||||
double delay_sensitivity = Double.parseDouble(appElement.getElementsByTagName("delay_sensitivity").item(0).getTextContent());
|
|
||||||
|
|
||||||
taskLookUpTable[i][0] = usage_percentage; //usage percentage [0-100]
|
for(int o=0; o<optionalAttributes.length; o++){
|
||||||
taskLookUpTable[i][1] = prob_cloud_selection; //prob. of selecting cloud [0-100]
|
double value = 0;
|
||||||
taskLookUpTable[i][2] = poisson_interarrival; //poisson mean (sec)
|
if(checkElement(appElement, optionalAttributes[o]))
|
||||||
taskLookUpTable[i][3] = active_period; //active period (sec)
|
value = Double.parseDouble(appElement.getElementsByTagName(optionalAttributes[o]).item(0).getTextContent());
|
||||||
taskLookUpTable[i][4] = idle_period; //idle period (sec)
|
|
||||||
taskLookUpTable[i][5] = data_upload; //avg data upload (KB)
|
taskLookUpTable[i][mandatoryAttributes.length + o] = value;
|
||||||
taskLookUpTable[i][6] = data_download; //avg data download (KB)
|
}
|
||||||
taskLookUpTable[i][7] = task_length; //avg task length (MI)
|
|
||||||
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]
|
|
||||||
taskLookUpTable[i][12] = delay_sensitivity; //delay_sensitivity [0-1]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
SimLogger.printLine("Edge Devices XML cannot be parsed! Terminating simulation...");
|
SimLogger.printLine("Edge Devices XML cannot be parsed! Terminating simulation...");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
System.exit(0);
|
System.exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -591,7 +680,7 @@ public class SimSettings {
|
|||||||
|
|
||||||
NodeList datacenterList = edgeDevicesDoc.getElementsByTagName("datacenter");
|
NodeList datacenterList = edgeDevicesDoc.getElementsByTagName("datacenter");
|
||||||
for (int i = 0; i < datacenterList.getLength(); i++) {
|
for (int i = 0; i < datacenterList.getLength(); i++) {
|
||||||
NUM_OF_EDGE_DATACENTERS++;
|
NUM_OF_EDGE_DATACENTERS++;
|
||||||
Node datacenterNode = datacenterList.item(i);
|
Node datacenterNode = datacenterList.item(i);
|
||||||
|
|
||||||
Element datacenterElement = (Element) datacenterNode;
|
Element datacenterElement = (Element) datacenterNode;
|
||||||
@ -616,7 +705,7 @@ public class SimSettings {
|
|||||||
|
|
||||||
NodeList hostList = datacenterElement.getElementsByTagName("host");
|
NodeList hostList = datacenterElement.getElementsByTagName("host");
|
||||||
for (int j = 0; j < hostList.getLength(); j++) {
|
for (int j = 0; j < hostList.getLength(); j++) {
|
||||||
NUM_OF_EDGE_HOSTS++;
|
NUM_OF_EDGE_HOSTS++;
|
||||||
Node hostNode = hostList.item(j);
|
Node hostNode = hostList.item(j);
|
||||||
|
|
||||||
Element hostElement = (Element) hostNode;
|
Element hostElement = (Element) hostNode;
|
||||||
@ -627,7 +716,7 @@ public class SimSettings {
|
|||||||
|
|
||||||
NodeList vmList = hostElement.getElementsByTagName("VM");
|
NodeList vmList = hostElement.getElementsByTagName("VM");
|
||||||
for (int k = 0; k < vmList.getLength(); k++) {
|
for (int k = 0; k < vmList.getLength(); k++) {
|
||||||
NUM_OF_EDGE_VMS++;
|
NUM_OF_EDGE_VMS++;
|
||||||
Node vmNode = vmList.item(k);
|
Node vmNode = vmList.item(k);
|
||||||
|
|
||||||
Element vmElement = (Element) vmNode;
|
Element vmElement = (Element) vmNode;
|
||||||
@ -643,7 +732,7 @@ public class SimSettings {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
SimLogger.printLine("Edge Devices XML cannot be parsed! Terminating simulation...");
|
SimLogger.printLine("Edge Devices XML cannot be parsed! Terminating simulation...");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
System.exit(0);
|
System.exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ public class CpuUtilizationModel_Custom implements UtilizationModel {
|
|||||||
index = 11;
|
index = 11;
|
||||||
else{
|
else{
|
||||||
SimLogger.printLine("Unknown VM Type! Terminating simulation...");
|
SimLogger.printLine("Unknown VM Type! Terminating simulation...");
|
||||||
System.exit(0);
|
System.exit(1);
|
||||||
}
|
}
|
||||||
return SimSettings.getInstance().getTaskLookUpTable()[task.getTaskType()][index];
|
return SimSettings.getInstance().getTaskLookUpTable()[task.getTaskType()][index];
|
||||||
}
|
}
|
||||||
|
@ -121,7 +121,7 @@ public class DefaultMobileDeviceManager extends MobileDeviceManager {
|
|||||||
protected void processOtherEvent(SimEvent ev) {
|
protected void processOtherEvent(SimEvent ev) {
|
||||||
if (ev == null) {
|
if (ev == null) {
|
||||||
SimLogger.printLine(getName() + ".processOtherEvent(): " + "Error - an event is null! Terminating simulation...");
|
SimLogger.printLine(getName() + ".processOtherEvent(): " + "Error - an event is null! Terminating simulation...");
|
||||||
System.exit(0);
|
System.exit(1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -162,7 +162,7 @@ public class DefaultMobileDeviceManager extends MobileDeviceManager {
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
SimLogger.printLine(getName() + ".processOtherEvent(): " + "Error - event unknown by this DatacenterBroker. Terminating simulation...");
|
SimLogger.printLine(getName() + ".processOtherEvent(): " + "Error - event unknown by this DatacenterBroker. Terminating simulation...");
|
||||||
System.exit(0);
|
System.exit(1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -180,7 +180,8 @@ public class DefaultMobileDeviceManager extends MobileDeviceManager {
|
|||||||
task.setSubmittedLocation(currentLocation);
|
task.setSubmittedLocation(currentLocation);
|
||||||
|
|
||||||
//add related task to log list
|
//add related task to log list
|
||||||
SimLogger.getInstance().addLog(task.getCloudletId(),
|
SimLogger.getInstance().addLog(task.getMobileDeviceId(),
|
||||||
|
task.getCloudletId(),
|
||||||
task.getTaskType(),
|
task.getTaskType(),
|
||||||
(int)task.getCloudletLength(),
|
(int)task.getCloudletLength(),
|
||||||
(int)task.getCloudletFileSize(),
|
(int)task.getCloudletFileSize(),
|
||||||
@ -226,7 +227,7 @@ public class DefaultMobileDeviceManager extends MobileDeviceManager {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SimLogger.printLine("Unknown nextHopId! Terminating simulation...");
|
SimLogger.printLine("Unknown nextHopId! Terminating simulation...");
|
||||||
System.exit(0);
|
System.exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,11 +13,13 @@ package edu.boun.edgecloudsim.edge_client;
|
|||||||
|
|
||||||
import org.cloudbus.cloudsim.Cloudlet;
|
import org.cloudbus.cloudsim.Cloudlet;
|
||||||
import org.cloudbus.cloudsim.UtilizationModel;
|
import org.cloudbus.cloudsim.UtilizationModel;
|
||||||
|
import org.cloudbus.cloudsim.core.CloudSim;
|
||||||
|
|
||||||
import edu.boun.edgecloudsim.utils.Location;
|
import edu.boun.edgecloudsim.utils.Location;
|
||||||
|
|
||||||
public class Task extends Cloudlet {
|
public class Task extends Cloudlet {
|
||||||
private Location submittedLocation;
|
private Location submittedLocation;
|
||||||
|
private double creationTime;
|
||||||
private int type;
|
private int type;
|
||||||
private int mobileDeviceId;
|
private int mobileDeviceId;
|
||||||
private int hostIndex;
|
private int hostIndex;
|
||||||
@ -34,6 +36,7 @@ public class Task extends Cloudlet {
|
|||||||
utilizationModelBw);
|
utilizationModelBw);
|
||||||
|
|
||||||
mobileDeviceId = _mobileDeviceId;
|
mobileDeviceId = _mobileDeviceId;
|
||||||
|
creationTime = CloudSim.clock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -80,4 +83,8 @@ public class Task extends Cloudlet {
|
|||||||
public int getTaskType(){
|
public int getTaskType(){
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public double getCreationTime() {
|
||||||
|
return creationTime;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,13 @@ public abstract class EdgeOrchestrator extends SimEntity{
|
|||||||
simScenario = _simScenario;
|
simScenario = _simScenario;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Default Constructor: Creates an empty EdgeOrchestrator
|
||||||
|
*/
|
||||||
|
public EdgeOrchestrator() {
|
||||||
|
super("EdgeOrchestrator");
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* initialize edge orchestrator if needed
|
* initialize edge orchestrator if needed
|
||||||
*/
|
*/
|
||||||
|
@ -10,6 +10,9 @@
|
|||||||
|
|
||||||
package edu.boun.edgecloudsim.edge_server;
|
package edu.boun.edgecloudsim.edge_server;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.cloudbus.cloudsim.CloudletScheduler;
|
import org.cloudbus.cloudsim.CloudletScheduler;
|
||||||
import org.cloudbus.cloudsim.Vm;
|
import org.cloudbus.cloudsim.Vm;
|
||||||
|
|
||||||
@ -28,4 +31,20 @@ public class EdgeVM extends Vm {
|
|||||||
public SimSettings.VM_TYPES getVmType(){
|
public SimSettings.VM_TYPES getVmType(){
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* dynamically reconfigures the mips value of a VM in CloudSim
|
||||||
|
*
|
||||||
|
* @param mips new mips value for this VM.
|
||||||
|
*/
|
||||||
|
public void reconfigureMips(double mips){
|
||||||
|
super.setMips(mips);
|
||||||
|
super.getHost().getVmScheduler().deallocatePesForVm(this);
|
||||||
|
|
||||||
|
List<Double> mipsShareAllocated = new ArrayList<Double>();
|
||||||
|
for(int i= 0; i<getNumberOfPes(); i++)
|
||||||
|
mipsShareAllocated.add(mips);
|
||||||
|
|
||||||
|
super.getHost().getVmScheduler().allocatePesForVm(this, mipsShareAllocated);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -98,7 +98,7 @@ public class EdgeVmAllocationPolicy_Custom extends VmAllocationPolicy {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean allocateHostForVm(Vm vm, Host host) {
|
public boolean allocateHostForVm(Vm vm, Host host) {
|
||||||
if (host.vmCreate(vm)) { // if vm has been succesfully created in the host
|
if (host.vmCreate(vm)) { // if vm has been successfully created in the host
|
||||||
getVmTable().put(vm.getUid(), host);
|
getVmTable().put(vm.getUid(), host);
|
||||||
createdVmNum++;
|
createdVmNum++;
|
||||||
|
|
||||||
|
@ -24,6 +24,12 @@ public abstract class MobilityModel {
|
|||||||
simulationTime=_simulationTime;
|
simulationTime=_simulationTime;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Default Constructor: Creates an empty MobilityModel
|
||||||
|
*/
|
||||||
|
public MobilityModel() {
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* calculate location of the devices according to related mobility model
|
* calculate location of the devices according to related mobility model
|
||||||
*/
|
*/
|
||||||
|
@ -99,7 +99,7 @@ public class NomadicMobility extends MobilityModel {
|
|||||||
}
|
}
|
||||||
if(!placeFound){
|
if(!placeFound){
|
||||||
SimLogger.printLine("impossible is occurred! location cannot be assigned to the device!");
|
SimLogger.printLine("impossible is occurred! location cannot be assigned to the device!");
|
||||||
System.exit(0);
|
System.exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -114,7 +114,7 @@ public class NomadicMobility extends MobilityModel {
|
|||||||
|
|
||||||
if(e == null){
|
if(e == null){
|
||||||
SimLogger.printLine("impossible is occurred! no location is found for the device '" + deviceId + "' at " + time);
|
SimLogger.printLine("impossible is occurred! no location is found for the device '" + deviceId + "' at " + time);
|
||||||
System.exit(0);
|
System.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return e.getValue();
|
return e.getValue();
|
||||||
|
@ -62,9 +62,9 @@ public class MM1Queue extends NetworkModel {
|
|||||||
avgTaskOutputSize = avgTaskOutputSize/numOfTaskType;
|
avgTaskOutputSize = avgTaskOutputSize/numOfTaskType;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* source device is always mobile device in our simulation scenarios!
|
* source device is always mobile device in our simulation scenarios!
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public double getUploadDelay(int sourceDeviceId, int destDeviceId, Task task) {
|
public double getUploadDelay(int sourceDeviceId, int destDeviceId, Task task) {
|
||||||
double delay = 0;
|
double delay = 0;
|
||||||
@ -90,9 +90,9 @@ public class MM1Queue extends NetworkModel {
|
|||||||
return delay;
|
return delay;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* destination device is always mobile device in our simulation scenarios!
|
* destination device is always mobile device in our simulation scenarios!
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public double getDownloadDelay(int sourceDeviceId, int destDeviceId, Task task) {
|
public double getDownloadDelay(int sourceDeviceId, int destDeviceId, Task task) {
|
||||||
//Special Case -> edge orchestrator to edge device
|
//Special Case -> edge orchestrator to edge device
|
||||||
@ -156,7 +156,7 @@ public class MM1Queue extends NetworkModel {
|
|||||||
avgTaskSize = avgTaskSize * (double)1000; //convert from KB to Byte
|
avgTaskSize = avgTaskSize * (double)1000; //convert from KB to Byte
|
||||||
|
|
||||||
Bps = bandwidth * (double)1000 / (double)8; //convert from Kbps to Byte per seconds
|
Bps = bandwidth * (double)1000 / (double)8; //convert from Kbps to Byte per seconds
|
||||||
lamda = ((double)1/(double)PoissonMean); //task per seconds
|
lamda = ((double)1/(double)PoissonMean); //task per seconds
|
||||||
mu = Bps / avgTaskSize ; //task per seconds
|
mu = Bps / avgTaskSize ; //task per seconds
|
||||||
double result = (double)1 / (mu-lamda*(double)deviceCount);
|
double result = (double)1 / (mu-lamda*(double)deviceCount);
|
||||||
|
|
||||||
|
@ -26,24 +26,24 @@ public abstract class NetworkModel {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* initializes custom network model
|
* initializes custom network model
|
||||||
*/
|
*/
|
||||||
public abstract void initialize();
|
public abstract void initialize();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* calculates the upload delay from source to destination device
|
* calculates the upload delay from source to destination device
|
||||||
*/
|
*/
|
||||||
public abstract double getUploadDelay(int sourceDeviceId, int destDeviceId, Task task);
|
public abstract double getUploadDelay(int sourceDeviceId, int destDeviceId, Task task);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* calculates the download delay from source to destination device
|
* calculates the download delay from source to destination device
|
||||||
*/
|
*/
|
||||||
public abstract double getDownloadDelay(int sourceDeviceId, int destDeviceId, Task task);
|
public abstract double getDownloadDelay(int sourceDeviceId, int destDeviceId, Task task);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mobile device manager should inform network manager about the network operation
|
* Mobile device manager should inform network manager about the network operation
|
||||||
* This information may be important for some network delay models
|
* This information may be important for some network delay models
|
||||||
*/
|
*/
|
||||||
public abstract void uploadStarted(Location accessPointLocation, int destDeviceId);
|
public abstract void uploadStarted(Location accessPointLocation, int destDeviceId);
|
||||||
public abstract void uploadFinished(Location accessPointLocation, int destDeviceId);
|
public abstract void uploadFinished(Location accessPointLocation, int destDeviceId);
|
||||||
public abstract void downloadStarted(Location accessPointLocation, int sourceDeviceId);
|
public abstract void downloadStarted(Location accessPointLocation, int sourceDeviceId);
|
||||||
|
@ -59,7 +59,7 @@ public class IdleActiveLoadGenerator extends LoadGeneratorModel{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(randomTaskType == -1){
|
if(randomTaskType == -1){
|
||||||
SimLogger.printLine("Impossible is occured! no random task type!");
|
SimLogger.printLine("Impossible is occurred! no random task type!");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,6 +29,12 @@ public abstract class LoadGeneratorModel {
|
|||||||
simScenario=_simScenario;
|
simScenario=_simScenario;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Default Constructor: Creates an empty LoadGeneratorModel
|
||||||
|
*/
|
||||||
|
public LoadGeneratorModel() {
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* each task has a virtual start time
|
* each task has a virtual start time
|
||||||
* it will be used while generating task
|
* it will be used while generating task
|
||||||
|
@ -21,6 +21,12 @@ public class Location {
|
|||||||
yPos = _yPos;
|
yPos = _yPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Default Constructor: Creates an empty Location
|
||||||
|
*/
|
||||||
|
public Location() {
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object other){
|
public boolean equals(Object other){
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
|
@ -20,31 +20,31 @@ public class PoissonDistr {
|
|||||||
Poisson poisson;
|
Poisson poisson;
|
||||||
RandomEngine engine;
|
RandomEngine engine;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new exponential number generator.
|
* Creates a new exponential number generator.
|
||||||
*
|
*
|
||||||
* @param mean the mean for the distribution.
|
* @param mean the mean for the distribution.
|
||||||
*/
|
*/
|
||||||
public PoissonDistr(double mean) {
|
public PoissonDistr(double mean) {
|
||||||
engine = new MersenneTwister(new Date());
|
engine = new MersenneTwister(new Date());
|
||||||
poisson = new Poisson(mean, engine);
|
poisson = new Poisson(mean, engine);
|
||||||
|
|
||||||
//always sleep for some milliseconds in order not to have same seed for iterative PoissonDistr contruction
|
//always sleep for some milliseconds in order not to have same seed for iterative PoissonDistr construction
|
||||||
try {
|
try {
|
||||||
TimeUnit.MILLISECONDS.sleep(10);
|
TimeUnit.MILLISECONDS.sleep(10);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
SimLogger.printLine("impossible is occurred! Poisson random number cannot be created!");
|
SimLogger.printLine("impossible is occurred! Poisson random number cannot be created!");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
System.exit(0);
|
System.exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate a new random number.
|
* Generate a new random number.
|
||||||
*
|
*
|
||||||
* @return the next random number in the sequence
|
* @return the next random number in the sequence
|
||||||
*/
|
*/
|
||||||
public double sample() {
|
public double sample() {
|
||||||
return poisson.nextDouble();
|
return poisson.nextDouble();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -16,26 +16,28 @@ import java.util.concurrent.TimeUnit;
|
|||||||
|
|
||||||
public class SimUtils {
|
public class SimUtils {
|
||||||
|
|
||||||
public static final Random RNG = new Random(System.currentTimeMillis());
|
public static final Random RNG = new Random(System.currentTimeMillis());
|
||||||
|
|
||||||
public static int getRandomNumber(int start, int end) {
|
public static int getRandomNumber(int start, int end) {
|
||||||
//return pd.sample();
|
//return pd.sample();
|
||||||
long range = (long)end - (long)start + 1;
|
long range = (long)end - (long)start + 1;
|
||||||
long fraction = (long)(range * RNG.nextDouble());
|
long fraction = (long)(range * RNG.nextDouble());
|
||||||
return (int)(fraction + start);
|
return (int)(fraction + start);
|
||||||
}
|
}
|
||||||
public static double getRandomDoubleNumber(double start, double end) {
|
|
||||||
//return pd.sample();
|
public static double getRandomDoubleNumber(double start, double end) {
|
||||||
|
//return pd.sample();
|
||||||
double range = end - start;
|
double range = end - start;
|
||||||
double fraction = (range * RNG.nextDouble());
|
double fraction = (range * RNG.nextDouble());
|
||||||
return (fraction + start);
|
return (fraction + start);
|
||||||
}
|
}
|
||||||
public static long getRandomLongNumber(int start, int end) {
|
|
||||||
//return pd.sample();
|
public static long getRandomLongNumber(long start, long end) {
|
||||||
|
//return pd.sample();
|
||||||
long range = (long)end - (long)start + 1;
|
long range = (long)end - (long)start + 1;
|
||||||
long fraction = (long)(range * RNG.nextDouble());
|
long fraction = (long)(range * RNG.nextDouble());
|
||||||
return (fraction + start);
|
return (fraction + start);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void cleanOutputFolder(String outputFolder){
|
public static void cleanOutputFolder(String outputFolder){
|
||||||
//clean the folder where the result files will be saved
|
//clean the folder where the result files will be saved
|
||||||
@ -49,16 +51,17 @@ public class SimUtils {
|
|||||||
if(!f.delete())
|
if(!f.delete())
|
||||||
{
|
{
|
||||||
SimLogger.printLine("file cannot be cleared: " + f.getAbsolutePath());
|
SimLogger.printLine("file cannot be cleared: " + f.getAbsolutePath());
|
||||||
System.exit(0);
|
System.exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SimLogger.printLine("Output folder is not available: " + outputFolder);
|
SimLogger.printLine("Output folder is not available: " + outputFolder);
|
||||||
System.exit(0);
|
System.exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getTimeDifference(Date startDate, Date endDate){
|
public static String getTimeDifference(Date startDate, Date endDate){
|
||||||
String result = "";
|
String result = "";
|
||||||
long duration = endDate.getTime() - startDate.getTime();
|
long duration = endDate.getTime() - startDate.getTime();
|
||||||
|
@ -15,59 +15,69 @@ import org.apache.commons.math3.distribution.ExponentialDistribution;
|
|||||||
import edu.boun.edgecloudsim.core.SimSettings;
|
import edu.boun.edgecloudsim.core.SimSettings;
|
||||||
|
|
||||||
public class TaskProperty {
|
public class TaskProperty {
|
||||||
private double startTime;
|
private double startTime;
|
||||||
private long length, inputFileSize, outputFileSize;
|
private long length, inputFileSize, outputFileSize;
|
||||||
private int taskType;
|
private int taskType;
|
||||||
private int pesNumber;
|
private int pesNumber;
|
||||||
private int mobileDeviceId;
|
private int mobileDeviceId;
|
||||||
|
|
||||||
public TaskProperty(double _startTime, int _mobileDeviceId, int _taskType, int _pesNumber, long _length, long _inputFileSize, long _outputFileSize) {
|
public TaskProperty(double _startTime, int _mobileDeviceId, int _taskType, int _pesNumber, long _length, long _inputFileSize, long _outputFileSize) {
|
||||||
startTime=_startTime;
|
startTime=_startTime;
|
||||||
mobileDeviceId=_mobileDeviceId;
|
mobileDeviceId=_mobileDeviceId;
|
||||||
taskType=_taskType;
|
taskType=_taskType;
|
||||||
pesNumber = _pesNumber;
|
pesNumber = _pesNumber;
|
||||||
length = _length;
|
length = _length;
|
||||||
outputFileSize = _inputFileSize;
|
outputFileSize = _inputFileSize;
|
||||||
inputFileSize = _outputFileSize;
|
inputFileSize = _outputFileSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TaskProperty(int _mobileDeviceId, int _taskType, double _startTime, ExponentialDistribution[][] expRngList) {
|
public TaskProperty(int _mobileDeviceId, int _taskType, double _startTime, ExponentialDistribution[][] expRngList) {
|
||||||
mobileDeviceId=_mobileDeviceId;
|
mobileDeviceId=_mobileDeviceId;
|
||||||
startTime=_startTime;
|
startTime=_startTime;
|
||||||
taskType=_taskType;
|
taskType=_taskType;
|
||||||
|
|
||||||
inputFileSize = (long)expRngList[_taskType][0].sample();
|
inputFileSize = (long)expRngList[_taskType][0].sample();
|
||||||
outputFileSize =(long)expRngList[_taskType][1].sample();
|
outputFileSize =(long)expRngList[_taskType][1].sample();
|
||||||
length = (long)expRngList[_taskType][2].sample();
|
length = (long)expRngList[_taskType][2].sample();
|
||||||
|
|
||||||
pesNumber = (int)SimSettings.getInstance().getTaskLookUpTable()[_taskType][8];
|
pesNumber = (int)SimSettings.getInstance().getTaskLookUpTable()[_taskType][8];
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getStartTime(){
|
public TaskProperty(int mobileDeviceId, double startTime, ExponentialDistribution[] expRngList) {
|
||||||
return startTime;
|
this.mobileDeviceId = mobileDeviceId;
|
||||||
}
|
this.startTime = startTime;
|
||||||
|
taskType = 0;
|
||||||
|
inputFileSize = (long)expRngList[0].sample();
|
||||||
|
outputFileSize = (long)expRngList[1].sample();
|
||||||
|
length = (long) expRngList[2].sample();
|
||||||
|
pesNumber = (int)SimSettings.getInstance().getTaskLookUpTable()[0][8];
|
||||||
|
}
|
||||||
|
|
||||||
public long getLength(){
|
public double getStartTime(){
|
||||||
return length;
|
return startTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getInputFileSize(){
|
public long getLength(){
|
||||||
return inputFileSize;
|
return length;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getOutputFileSize(){
|
public long getInputFileSize(){
|
||||||
return outputFileSize;
|
return inputFileSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getTaskType(){
|
public long getOutputFileSize(){
|
||||||
return taskType;
|
return outputFileSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getPesNumber(){
|
public int getTaskType(){
|
||||||
return pesNumber;
|
return taskType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMobileDeviceId(){
|
public int getPesNumber(){
|
||||||
return mobileDeviceId;
|
return pesNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getMobileDeviceId(){
|
||||||
|
return mobileDeviceId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user