Fixed most of the currently discovered typos.

This commit is contained in:
Hc Wang
2019-03-19 09:02:08 +08:00
parent 97bb697113
commit dc27788628
37 changed files with 95 additions and 95 deletions

View File

@ -32,7 +32,7 @@ public class MainApp {
//disable console output of cloudsim library
Log.disable();
//enable console ourput and file output of this application
//enable console output and file output of this application
SimLogger.enablePrintLog();
int iterationNumber = 1;

View File

@ -32,7 +32,7 @@ public class MainApp {
//disable console output of cloudsim library
Log.disable();
//enable console ourput and file output of this application
//enable console output and file output of this application
SimLogger.enablePrintLog();
int iterationNumber = 1;

View File

@ -91,12 +91,12 @@ public class SampleEdgeOrchestrator extends EdgeOrchestrator {
result = SimSettings.GENERIC_EDGE_DEVICE_ID;
}
else {
SimLogger.printLine("Unknow edge orchestrator policy! Terminating simulation...");
SimLogger.printLine("Unknown edge orchestrator policy! Terminating simulation...");
System.exit(0);
}
}
else {
SimLogger.printLine("Unknow simulation scenario! Terminating simulation...");
SimLogger.printLine("Unknown simulation scenario! Terminating simulation...");
System.exit(0);
}
return result;

View File

@ -36,7 +36,7 @@ public class SampleNetworkModel extends NetworkModel {
private int[] wanClients;
private int[] wlanClients;
private double lastMM1QueeuUpdateTime;
private double lastMM1QueueUpdateTime;
private double ManPoissonMeanForDownload; //seconds
private double ManPoissonMeanForUpload; //seconds
@ -194,7 +194,7 @@ public class SampleNetworkModel extends NetworkModel {
SimSettings SS = SimSettings.getInstance();
for(int taskIndex=0; taskIndex<numOfApp; taskIndex++) {
if(SS.getTaskLookUpTable()[taskIndex][0] == 0) {
SimLogger.printLine("Usage percantage of task " + taskIndex + " is 0! Terminating simulation...");
SimLogger.printLine("Usage percentage of task " + taskIndex + " is 0! Terminating simulation...");
System.exit(0);
}
else{
@ -214,7 +214,7 @@ public class SampleNetworkModel extends NetworkModel {
avgManTaskInputSize = avgManTaskInputSize/numOfApp;
avgManTaskOutputSize = avgManTaskOutputSize/numOfApp;
lastMM1QueeuUpdateTime = SimSettings.CLIENT_ACTIVITY_START_TIME;
lastMM1QueueUpdateTime = SimSettings.CLIENT_ACTIVITY_START_TIME;
totalManTaskOutputSize = 0;
numOfManTaskForDownload = 0;
totalManTaskInputSize = 0;
@ -364,7 +364,7 @@ public class SampleNetworkModel extends NetworkModel {
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;
avgTaskSize = avgTaskSize * 8; //convert from KB to Kb
@ -376,7 +376,7 @@ public class SampleNetworkModel extends NetworkModel {
if(result < 0)
return 0;
result += propogationDelay;
result += propagationDelay;
return (result > 15) ? 0 : result;
}
@ -412,8 +412,8 @@ public class SampleNetworkModel extends NetworkModel {
}
public void updateMM1QueeuModel(){
double lastInterval = CloudSim.clock() - lastMM1QueeuUpdateTime;
lastMM1QueeuUpdateTime = CloudSim.clock();
double lastInterval = CloudSim.clock() - lastMM1QueueUpdateTime;
lastMM1QueueUpdateTime = CloudSim.clock();
if(numOfManTaskForDownload != 0){
ManPoissonMeanForDownload = lastInterval / (numOfManTaskForDownload / (double)numberOfMobileDevices);

View File

@ -32,7 +32,7 @@ public class MainApp {
//disable console output of cloudsim library
Log.disable();
//enable console ourput and file output of this application
//enable console output and file output of this application
SimLogger.enablePrintLog();
int iterationNumber = 1;

View File

@ -65,7 +65,7 @@ public class SampleMobileServerManager extends MobileServerManager{
}
@Override
public void createVmList(int brockerId) {
public void createVmList(int brokerId) {
//VMs should have unique IDs, so create Mobile VMs after Edge+Cloud VMs
int vmCounter=SimSettings.getInstance().getNumOfEdgeVMs() + SimSettings.getInstance().getNumOfCloudVMs();
@ -82,7 +82,7 @@ public class SampleMobileServerManager extends MobileServerManager{
long bandwidth = 0;
//VM Parameters
MobileVM vm = new MobileVM(vmCounter, brockerId, mips, numOfCores, ram, bandwidth, storage, vmm, new CloudletSchedulerTimeShared());
MobileVM vm = new MobileVM(vmCounter, brokerId, mips, numOfCores, ram, bandwidth, storage, vmm, new CloudletSchedulerTimeShared());
vmList.get(i).add(vm);
vmCounter++;
}
@ -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
MobileHost host = new MobileHost(
//Hosts should have unique IDs, so create Mobile Hosts after Edge+Cloud Hosts
i+SimSettings.getInstance().getNumOfEdgeHosts()+SimSettings.getInstance().getNumOfCoudHost(),
i+SimSettings.getInstance().getNumOfEdgeHosts()+SimSettings.getInstance().getNumOfCouldHost(),
new RamProvisionerSimple(ram),
new BwProvisionerSimple(bandwidth), //kbps
storage,

View File

@ -96,16 +96,16 @@ public class FuzzyEdgeOrchestrator extends EdgeOrchestrator {
for(int hostIndex=0; hostIndex<numberOfHost; hostIndex++){
List<EdgeVM> vmArray = SimManager.getInstance().getEdgeServerManager().getVmList(hostIndex);
double totalUtlization=0;
double totalUtilization=0;
for(int vmIndex=0; vmIndex<vmArray.size(); vmIndex++){
totalUtlization += vmArray.get(vmIndex).getCloudletScheduler().getTotalUtilizationOfCpu(CloudSim.clock());
totalUtilization += vmArray.get(vmIndex).getCloudletScheduler().getTotalUtilizationOfCpu(CloudSim.clock());
}
double avgUtilization = (totalUtlization / (double)(vmArray.size()));
double avgUtilization = (totalUtilization / (double)(vmArray.size()));
EdgeHost host = (EdgeHost)(vmArray.get(0).getHost()); //all VMs have the same host
if(host.getLocation().getServingWlanId() == task.getSubmittedLocation().getServingWlanId()){
nearestEdgeUtilization = totalUtlization / (double)(vmArray.size());
nearestEdgeUtilization = totalUtilization / (double)(vmArray.size());
nearestEdgeHostIndex = hostIndex;
}
else if(avgUtilization < bestRemoteEdgeUtilization){
@ -220,12 +220,12 @@ public class FuzzyEdgeOrchestrator extends EdgeOrchestrator {
result = SimSettings.GENERIC_EDGE_DEVICE_ID;
}
else {
SimLogger.printLine("Unknow edge orchestrator policy! Terminating simulation...");
SimLogger.printLine("Unknown edge orchestrator policy! Terminating simulation...");
System.exit(0);
}
}
else {
SimLogger.printLine("Unknow simulation scenario! Terminating simulation...");
SimLogger.printLine("Unknown simulation scenario! Terminating simulation...");
System.exit(0);
}
return result;

View File

@ -187,7 +187,7 @@ public class FuzzyExperimentalNetworkModel extends NetworkModel {
SimSettings SS = SimSettings.getInstance();
for(int taskIndex=0; taskIndex<numOfApp; taskIndex++) {
if(SS.getTaskLookUpTable()[taskIndex][0] == 0) {
SimLogger.printLine("Usage percantage of task " + taskIndex + " is 0! Terminating simulation...");
SimLogger.printLine("Usage percentage of task " + taskIndex + " is 0! Terminating simulation...");
System.exit(0);
}
else{
@ -275,7 +275,7 @@ public class FuzzyExperimentalNetworkModel extends NetworkModel {
else if (destDeviceId == SimSettings.GENERIC_EDGE_DEVICE_ID+1)
manClients++;
else {
SimLogger.printLine("Error - unknoqn device id in FuzzyExperimentalNetworkModel.uploadStarted(. Terminating simulation...");
SimLogger.printLine("Error - unknown device id in FuzzyExperimentalNetworkModel.uploadStarted(. Terminating simulation...");
System.exit(0);
}
}
@ -289,7 +289,7 @@ public class FuzzyExperimentalNetworkModel extends NetworkModel {
else if (destDeviceId == SimSettings.GENERIC_EDGE_DEVICE_ID+1)
manClients--;
else {
SimLogger.printLine("Error - unknoqn device id in FuzzyExperimentalNetworkModel.uploadFinished(. Terminating simulation...");
SimLogger.printLine("Error - unknown device id in FuzzyExperimentalNetworkModel.uploadFinished(. Terminating simulation...");
System.exit(0);
}
}
@ -303,7 +303,7 @@ public class FuzzyExperimentalNetworkModel extends NetworkModel {
else if(sourceDeviceId == SimSettings.GENERIC_EDGE_DEVICE_ID+1)
manClients++;
else {
SimLogger.printLine("Error - unknoqn device id in FuzzyExperimentalNetworkModel.downloadStarted(. Terminating simulation...");
SimLogger.printLine("Error - unknown device id in FuzzyExperimentalNetworkModel.downloadStarted(. Terminating simulation...");
System.exit(0);
}
}
@ -317,7 +317,7 @@ public class FuzzyExperimentalNetworkModel extends NetworkModel {
else if(sourceDeviceId == SimSettings.GENERIC_EDGE_DEVICE_ID+1)
manClients--;
else {
SimLogger.printLine("Error - unknoqn device id in FuzzyExperimentalNetworkModel.downloadFinished(. Terminating simulation...");
SimLogger.printLine("Error - unknown device id in FuzzyExperimentalNetworkModel.downloadFinished(. Terminating simulation...");
System.exit(0);
}
}

View File

@ -32,7 +32,7 @@ public class FuzzyMainApp {
//disable console output of cloudsim library
Log.disable();
//enable console ourput and file output of this application
//enable console output and file output of this application
SimLogger.enablePrintLog();
int iterationNumber = 1;

View File

@ -61,7 +61,7 @@ public abstract class CloudServerManager {
/*
* Creates VM List
*/
public abstract void createVmList(int brockerId);
public abstract void createVmList(int brokerId);
/*
* returns average utilization of all VMs

View File

@ -53,7 +53,7 @@ public class CloudVmAllocationPolicy_Custom extends VmAllocationPolicy {
Host host = getHostList().get(hostIndex);
result = host.vmCreate(vm);
if (result) { // if vm were succesfully created in the host
if (result) { // if vm were successfully created in the host
getVmTable().put(vm.getUid(), host);
createdVmNum++;
Log.formatLine("%.2f: Cloud VM #" + vm.getId() + " has been allocated to the host #" + host.getId(),CloudSim.clock());

View File

@ -53,12 +53,12 @@ public class DefaultCloudServerManager extends CloudServerManager{
localDatacenter.shutdownEntity();
}
public void createVmList(int brockerId){
public void createVmList(int brokerId){
//VMs should have unique IDs, so create Cloud VMs after Edge VMs
int vmCounter=SimSettings.getInstance().getNumOfEdgeVMs();
//Create VMs for each hosts
for (int i = 0; i < SimSettings.getInstance().getNumOfCoudHost(); i++) {
for (int i = 0; i < SimSettings.getInstance().getNumOfCouldHost(); i++) {
vmList.add(i, new ArrayList<CloudVM>());
for(int j = 0; j < SimSettings.getInstance().getNumOfCloudVMsPerHost(); j++){
String vmm = "Xen";
@ -69,7 +69,7 @@ public class DefaultCloudServerManager extends CloudServerManager{
long bandwidth = 0;
//VM Parameters
CloudVM vm = new CloudVM(vmCounter, brockerId, mips, numOfCores, ram, bandwidth, storage, vmm, new CloudletSchedulerTimeShared());
CloudVM vm = new CloudVM(vmCounter, brokerId, mips, numOfCores, ram, bandwidth, storage, vmm, new CloudletSchedulerTimeShared());
vmList.get(i).add(vm);
vmCounter++;
}
@ -131,7 +131,7 @@ public class DefaultCloudServerManager extends CloudServerManager{
// 1. We need to create a list to store one or more Machines
List<Host> hostList = new ArrayList<Host>();
for (int i = 0; i < SimSettings.getInstance().getNumOfCoudHost(); i++) {
for (int i = 0; i < SimSettings.getInstance().getNumOfCouldHost(); i++) {
int numOfVMPerHost = SimSettings.getInstance().getNumOfCloudVMsPerHost();
int numOfCores = SimSettings.getInstance().getCoreForCloudVM() * numOfVMPerHost;
double mips = SimSettings.getInstance().getMipsForCloudVM() * numOfVMPerHost;

View File

@ -185,7 +185,7 @@ public class SimManager extends SimEntity {
}
}
for(int i= 0; i<SimSettings.getInstance().getNumOfCoudHost(); i++) {
for(int i = 0; i<SimSettings.getInstance().getNumOfCouldHost(); i++) {
mobileDeviceManager.submitVmList(cloudServerManager.getVmList(i));
}

View File

@ -5,7 +5,7 @@
* SimSettings provides system wide simulation settings. It is a
* singleton class and provides all necessary information to other modules.
* If you need to use another simulation setting variable in your
* config file, add related getter methot in this class.
* config file, add related getter method in this class.
*
* Licence: GPL - http://www.gnu.org/copyleft/gpl.html
* Copyright (c) 2017, Bogazici University, Istanbul, Turkey
@ -145,7 +145,7 @@ public class SimSettings {
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"));
WAN_PROPOGATION_DELAY = Double.parseDouble(prop.getProperty("wan_propogation_delay"));
WAN_PROPOGATION_DELAY = Double.parseDouble(prop.getProperty("wan_propagation_delay"));
LAN_INTERNAL_DELAY = Double.parseDouble(prop.getProperty("lan_internal_delay"));
BANDWITH_WLAN = 1000 * Integer.parseInt(prop.getProperty("wlan_bandwidth"));
BANDWITH_WAN = 1000 * Integer.parseInt(prop.getProperty("wan_bandwidth"));
@ -192,7 +192,7 @@ public class SimSettings {
}
}
}
parseApplicatinosXML(applicationsFile);
parseApplicationsXML(applicationsFile);
parseEdgeDevicesXML(edgeDevicesFile);
return result;
@ -255,15 +255,15 @@ public class SimSettings {
}
/**
* returns WAN propogation delay (in second unit) from properties file
* returns WAN propagation delay (in second unit) from properties file
*/
public double getWanPropogationDelay()
public double getWanPropagationDelay()
{
return WAN_PROPOGATION_DELAY;
}
/**
* returns internal LAN propogation delay (in second unit) from properties file
* returns internal LAN propagation delay (in second unit) from properties file
*/
public double getInternalLanDelay()
{
@ -303,7 +303,7 @@ public class SimSettings {
}
/**
* returns the maximunm number of the mobile devices used in the simulation
* returns the maximum number of the mobile devices used in the simulation
*/
public int getMaxNumOfMobileDev()
{
@ -354,7 +354,7 @@ public class SimSettings {
/**
* returns the number of cloud datacenters
*/
public int getNumOfCoudHost()
public int getNumOfCouldHost()
{
return NUM_OF_HOST_ON_CLOUD_DATACENTER;
}
@ -440,7 +440,7 @@ public class SimSettings {
}
/**
* returns simulation screnarios as string
* returns simulation scenarios as string
*/
public String[] getSimulationScenarios()
{
@ -491,10 +491,10 @@ public class SimSettings {
return taskNames[taskType];
}
private void isAttribtuePresent(Element element, String key) {
private void isAttributePresent(Element element, String key) {
String value = element.getAttribute(key);
if (value.isEmpty() || value == null){
throw new IllegalArgumentException("Attribure '" + key + "' is not found in '" + element.getNodeName() +"'");
throw new IllegalArgumentException("Attribute '" + key + "' is not found in '" + element.getNodeName() +"'");
}
}
@ -509,7 +509,7 @@ public class SimSettings {
}
}
private void parseApplicatinosXML(String filePath)
private void parseApplicationsXML(String filePath)
{
Document doc = null;
try {
@ -526,7 +526,7 @@ public class SimSettings {
Node appNode = appList.item(i);
Element appElement = (Element) appNode;
isAttribtuePresent(appElement, "name");
isAttributePresent(appElement, "name");
isElementPresent(appElement, "usage_percentage");
isElementPresent(appElement, "prob_cloud_selection");
isElementPresent(appElement, "poisson_interarrival");
@ -595,9 +595,9 @@ public class SimSettings {
Node datacenterNode = datacenterList.item(i);
Element datacenterElement = (Element) datacenterNode;
isAttribtuePresent(datacenterElement, "arch");
isAttribtuePresent(datacenterElement, "os");
isAttribtuePresent(datacenterElement, "vmm");
isAttributePresent(datacenterElement, "arch");
isAttributePresent(datacenterElement, "os");
isAttributePresent(datacenterElement, "vmm");
isElementPresent(datacenterElement, "costPerBw");
isElementPresent(datacenterElement, "costPerSec");
isElementPresent(datacenterElement, "costPerMem");
@ -631,7 +631,7 @@ public class SimSettings {
Node vmNode = vmList.item(k);
Element vmElement = (Element) vmNode;
isAttribtuePresent(vmElement, "vmm");
isAttributePresent(vmElement, "vmm");
isElementPresent(vmElement, "core");
isElementPresent(vmElement, "mips");
isElementPresent(vmElement, "ram");

View File

@ -8,7 +8,7 @@
* which decide CPU utilization of each application by using the
* values defined in the applications.xml file. For those who wants to
* add another VM Cpu Utilization Model to EdgeCloudSim should provide
* another concreate instance of UtilizationModel via ScenarioFactory
* another concrete instance of UtilizationModel via ScenarioFactory
*
* Licence: GPL - http://www.gnu.org/copyleft/gpl.html
* Copyright (c) 2017, Bogazici University, Istanbul, Turkey

View File

@ -33,7 +33,7 @@ import edu.boun.edgecloudsim.utils.SimLogger;
public class DefaultMobileDeviceManager extends MobileDeviceManager {
private static final int BASE = 100000; //start from base in order not to conflict cloudsim tag!
private static final int REQUEST_RECEIVED_BY_CLOUD = BASE + 1;
private static final int REQUEST_RECIVED_BY_EDGE_DEVICE = BASE + 2;
private static final int REQUEST_RECEIVED_BY_EDGE_DEVICE = BASE + 2;
private static final int RESPONSE_RECEIVED_BY_MOBILE_DEVICE = BASE + 3;
private int taskIdCounter=0;
@ -138,7 +138,7 @@ public class DefaultMobileDeviceManager extends MobileDeviceManager {
break;
}
case REQUEST_RECIVED_BY_EDGE_DEVICE:
case REQUEST_RECEIVED_BY_EDGE_DEVICE:
{
Task task = (Task) ev.getData();
@ -212,7 +212,7 @@ public class DefaultMobileDeviceManager extends MobileDeviceManager {
if(WlanDelay > 0){
networkModel.uploadStarted(currentLocation, nextHopId);
schedule(getId(), WlanDelay, REQUEST_RECIVED_BY_EDGE_DEVICE, task);
schedule(getId(), WlanDelay, REQUEST_RECEIVED_BY_EDGE_DEVICE, task);
SimLogger.getInstance().taskStarted(task.getCloudletId(), CloudSim.clock());
SimLogger.getInstance().setUploadDelay(task.getCloudletId(), WlanDelay, NETWORK_DELAY_TYPES.WLAN_DELAY);
}

View File

@ -46,7 +46,7 @@ public class DefaultMobileServerManager extends MobileServerManager{
}
@Override
public void createVmList(int brockerId) {
public void createVmList(int brokerId) {
//local computation is not supported in default Mobile Device Manager
}

View File

@ -69,7 +69,7 @@ public abstract class MobileServerManager {
/*
* Creates VM List
*/
public abstract void createVmList(int brockerId);
public abstract void createVmList(int brokerId);
/*
* returns average utilization of all VMs

View File

@ -58,7 +58,7 @@ public class MobileVmAllocationPolicy_Custom extends VmAllocationPolicy {
Host host = getHostList().get(hostIndex);
result = host.vmCreate(vm);
if (result) { // if vm were succesfully created in the host
if (result) { // if vm were successfully created in the host
getVmTable().put(vm.getUid(), host);
createdVmNum++;
Log.formatLine("%.2f: Mobile VM #" + vm.getId() + " has been allocated to the host #" + host.getId(),CloudSim.clock());
@ -72,7 +72,7 @@ public class MobileVmAllocationPolicy_Custom extends VmAllocationPolicy {
@Override
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);
createdVmNum++;

View File

@ -5,7 +5,7 @@
* EdgeOrchestrator is an abstract class which is used for selecting VM
* for each client requests. For those who wants to add a custom
* Edge Orchestrator to EdgeCloudSim should extend this class and provide
* a concreate instance via ScenarioFactory
* a concrete instance via ScenarioFactory
*
* Licence: GPL - http://www.gnu.org/copyleft/gpl.html
* Copyright (c) 2017, Bogazici University, Istanbul, Turkey

View File

@ -63,7 +63,7 @@ public class DefaultEdgeServerManager extends EdgeServerManager{
}
}
public void createVmList(int brockerId){
public void createVmList(int brokerId){
int hostCounter=0;
int vmCounter=0;
@ -93,7 +93,7 @@ public class DefaultEdgeServerManager extends EdgeServerManager{
long bandwidth = SimSettings.getInstance().getWlanBandwidth() / (hostNodeList.getLength()+vmNodeList.getLength());
//VM Parameters
EdgeVM vm = new EdgeVM(vmCounter, brockerId, mips, numOfCores, ram, bandwidth, storage, vmm, new CloudletSchedulerTimeShared());
EdgeVM vm = new EdgeVM(vmCounter, brokerId, mips, numOfCores, ram, bandwidth, storage, vmm, new CloudletSchedulerTimeShared());
vmList.get(hostCounter).add(vm);
vmCounter++;
}

View File

@ -62,7 +62,7 @@ public abstract class EdgeServerManager {
/*
* Creates VM List
*/
public abstract void createVmList(int brockerId);
public abstract void createVmList(int brokerId);
/*
* returns average utilization of all VMs

View File

@ -84,7 +84,7 @@ public class EdgeVmAllocationPolicy_Custom extends VmAllocationPolicy {
Host host = getHostList().get(hostIndex);
result = host.vmCreate(vm);
if (result) { // if vm were succesfully created in the host
if (result) { // if vm were successfully created in the host
getVmTable().put(vm.getUid(), host);
createdVmNum++;
Log.formatLine("%.2f: Edge VM #" + vm.getId() + " has been allocated to the host #" + host.getId(),CloudSim.clock());

View File

@ -5,7 +5,7 @@
* MobilityModel is an abstract class which is used for calculating the
* location of each mobile devices with respect to the time. For those who
* wants to add a custom Mobility Model to EdgeCloudSim should extend
* this class and provide a concreate instance via ScenarioFactory
* this class and provide a concrete instance via ScenarioFactory
*
* Licence: GPL - http://www.gnu.org/copyleft/gpl.html
* Copyright (c) 2017, Bogazici University, Istanbul, Turkey

View File

@ -98,7 +98,7 @@ public class NomadicMobility extends MobilityModel {
}
}
if(!placeFound){
SimLogger.printLine("impossible is occured! location cannot be assigned to the device!");
SimLogger.printLine("impossible is occurred! location cannot be assigned to the device!");
System.exit(0);
}
}
@ -113,7 +113,7 @@ public class NomadicMobility extends MobilityModel {
Entry<Double, Location> e = treeMap.floorEntry(time);
if(e == null){
SimLogger.printLine("impossible is occured! 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);
}

View File

@ -122,7 +122,7 @@ public class MM1Queue extends NetworkModel {
getHostList().get(0));
//if source device id is the edge server which is located in another location, add internal lan delay
//in our scenasrio, serving wlan ID is equal to the host id, because there is only one host in one place
//in our scenario, serving wlan ID is equal to the host id, because there is only one host in one place
if(host.getLocation().getServingWlanId() != accessPointLocation.getServingWlanId())
delay += (SimSettings.getInstance().getInternalLanDelay() * 2);
}
@ -150,7 +150,7 @@ public class MM1Queue extends NetworkModel {
return deviceCount;
}
private double calculateMM1(double propogationDelay, int bandwidth /*Kbps*/, double PoissonMean, double avgTaskSize /*KB*/, int deviceCount){
private double calculateMM1(double propagationDelay, int bandwidth /*Kbps*/, double PoissonMean, double avgTaskSize /*KB*/, int deviceCount){
double Bps=0, mu=0, lamda=0;
avgTaskSize = avgTaskSize * (double)1000; //convert from KB to Byte
@ -160,7 +160,7 @@ public class MM1Queue extends NetworkModel {
mu = Bps / avgTaskSize ; //task per seconds
double result = (double)1 / (mu-lamda*(double)deviceCount);
result += propogationDelay;
result += propagationDelay;
return (result > 5) ? -1 : result;
}
@ -182,7 +182,7 @@ public class MM1Queue extends NetworkModel {
}
private double getWanDownloadDelay(Location accessPointLocation, double time) {
return calculateMM1(SimSettings.getInstance().getWanPropogationDelay(),
return calculateMM1(SimSettings.getInstance().getWanPropagationDelay(),
SimSettings.getInstance().getWanBandwidth(),
WanPoissonMean,
avgTaskOutputSize,
@ -190,7 +190,7 @@ public class MM1Queue extends NetworkModel {
}
private double getWanUploadDelay(Location accessPointLocation, double time) {
return calculateMM1(SimSettings.getInstance().getWanPropogationDelay(),
return calculateMM1(SimSettings.getInstance().getWanPropagationDelay(),
SimSettings.getInstance().getWanBandwidth(),
WanPoissonMean,
avgTaskInputSize,

View File

@ -5,7 +5,7 @@
* NetworkModel is an abstract class which is used for calculating the
* network delay from device to device. For those who wants to add a
* custom Network Model to EdgeCloudSim should extend this class and
* provide a concreate instance via ScenarioFactory
* provide a concrete instance via ScenarioFactory
*
* Licence: GPL - http://www.gnu.org/copyleft/gpl.html
* Copyright (c) 2017, Bogazici University, Istanbul, Turkey

View File

@ -78,7 +78,7 @@ public class IdleActiveLoadGenerator extends LoadGeneratorModel{
double interval = rng.sample();
if(interval <= 0){
SimLogger.printLine("Impossible is occured! interval is " + interval + " for device " + i + " time " + virtualTime);
SimLogger.printLine("Impossible is occurred! interval is " + interval + " for device " + i + " time " + virtualTime);
continue;
}
//SimLogger.printLine(virtualTime + " -> " + interval + " for device " + i + " time ");

View File

@ -5,7 +5,7 @@
* LoadGeneratorModel is an abstract class which is used for
* deciding task generation pattern via a task list. For those who
* wants to add a custom Load Generator Model to EdgeCloudSim should
* extend this class and provide a concreate instance via ScenarioFactory
* extend this class and provide a concrete instance via ScenarioFactory
*
* Licence: GPL - http://www.gnu.org/copyleft/gpl.html
* Copyright (c) 2017, Bogazici University, Istanbul, Turkey

View File

@ -1,8 +1,8 @@
/*
* Title: EdgeCloudSim - Poisson Distribution
*
*
* Description: Wrapper class for colt Poisson Distribution
*
*
* Licence: GPL - http://www.gnu.org/copyleft/gpl.html
* Copyright (c) 2017, Bogazici University, Istanbul, Turkey
*/
@ -22,18 +22,18 @@ public class PoissonDistr {
/**
* Creates a new exponential number generator.
*
*
* @param mean the mean for the distribution.
*/
public PoissonDistr(double mean) {
engine = new MersenneTwister(new Date());
poisson = new Poisson(mean, engine);
//always sleep for some milliseconds in order not to have same seed for iterative PoissonDistr contruction
try {
TimeUnit.MILLISECONDS.sleep(10);
} catch (InterruptedException e) {
SimLogger.printLine("impossible is occured! Poisson random number cannot be created!");
SimLogger.printLine("impossible is occurred! Poisson random number cannot be created!");
e.printStackTrace();
System.exit(0);
}
@ -41,10 +41,10 @@ public class PoissonDistr {
/**
* Generate a new random number.
*
*
* @return the next random number in the sequence
*/
public double sample() {
public double sample() {
return poisson.nextDouble();
}
}

View File

@ -31,7 +31,7 @@ import edu.boun.edgecloudsim.utils.SimLogger.NETWORK_ERRORS;
public class SimLogger {
public static enum TASK_STATUS {
CREATED, UPLOADING, PROCESSING, DOWNLOADING, COMLETED, REJECTED_DUE_TO_VM_CAPACITY, REJECTED_DUE_TO_BANDWIDTH, UNFINISHED_DUE_TO_BANDWIDTH, UNFINISHED_DUE_TO_MOBILITY
CREATED, UPLOADING, PROCESSING, DOWNLOADING, COMPLETED, REJECTED_DUE_TO_VM_CAPACITY, REJECTED_DUE_TO_BANDWIDTH, UNFINISHED_DUE_TO_BANDWIDTH, UNFINISHED_DUE_TO_MOBILITY
}
public static enum NETWORK_ERRORS {
@ -264,7 +264,7 @@ public class SimLogger {
if (value.isInWarmUpPeriod())
continue;
if (value.getStatus() == SimLogger.TASK_STATUS.COMLETED) {
if (value.getStatus() == SimLogger.TASK_STATUS.COMPLETED) {
completedTask[value.getTaskType()]++;
if (value.getVmType() == SimSettings.VM_TYPES.CLOUD_VM.ordinal())
@ -298,7 +298,7 @@ public class SimLogger {
failedTaskOnEdge[value.getTaskType()]++;
}
if (value.getStatus() == SimLogger.TASK_STATUS.COMLETED) {
if (value.getStatus() == SimLogger.TASK_STATUS.COMPLETED) {
cost[value.getTaskType()] += value.getCost();
serviceTime[value.getTaskType()] += value.getServiceTime();
networkDelay[value.getTaskType()] += value.getNetworkDelay();
@ -705,9 +705,9 @@ class LogItem {
private double cpuCost;
private boolean isInWarmUpPeriod;
LogItem(int _taskType, int _taskLenght, int _taskInputType, int _taskOutputSize) {
LogItem(int _taskType, int _taskLength, int _taskInputType, int _taskOutputSize) {
taskType = _taskType;
taskLenght = _taskLenght;
taskLenght = _taskLength;
taskInputType = _taskInputType;
taskOutputSize = _taskOutputSize;
networkError = NETWORK_ERRORS.NONE;
@ -757,7 +757,7 @@ class LogItem {
public void taskEnded(double time) {
taskEndTime = time;
status = SimLogger.TASK_STATUS.COMLETED;
status = SimLogger.TASK_STATUS.COMPLETED;
}
public void taskRejectedDueToVMCapacity(double time, int _vmType) {
@ -881,7 +881,7 @@ class LogItem {
+ taskOutputSize + SimSettings.DELIMITER + taskStartTime + SimSettings.DELIMITER + taskEndTime
+ SimSettings.DELIMITER;
if (status == SimLogger.TASK_STATUS.COMLETED){
if (status == SimLogger.TASK_STATUS.COMPLETED){
result += getNetworkDelay() + SimSettings.DELIMITER;
result += getNetworkDelay(NETWORK_DELAY_TYPES.WLAN_DELAY) + SimSettings.DELIMITER;
result += getNetworkDelay(NETWORK_DELAY_TYPES.MAN_DELAY) + SimSettings.DELIMITER;