Commit 225d6749 authored by Anton Beloglazov's avatar Anton Beloglazov

Updated the javadocs, headers, code formatting, and Maven configuration (new…

Updated the javadocs, headers, code formatting, and Maven configuration (new versions of the dependencies)
parent 62de8e30
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId> <artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-5</version>
<executions> <executions>
<execution> <execution>
<phase>install</phase> <phase>install</phase>
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
<dependency> <dependency>
<groupId>${project.groupId}</groupId> <groupId>${project.groupId}</groupId>
<artifactId>cloudsim</artifactId> <artifactId>cloudsim</artifactId>
<version>${project.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId> <artifactId>maven-javadoc-plugin</artifactId>
<version>2.8</version>
<executions> <executions>
<execution> <execution>
<id>docs</id> <id>docs</id>
...@@ -33,12 +34,12 @@ ...@@ -33,12 +34,12 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId> <artifactId>maven-javadoc-plugin</artifactId>
<version>2.7</version> <version>2.8</version>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId> <artifactId>maven-jxr-plugin</artifactId>
<version>2.2</version> <version>2.3</version>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.sonatype.maven.plugin</groupId> <groupId>org.sonatype.maven.plugin</groupId>
...@@ -48,7 +49,7 @@ ...@@ -48,7 +49,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId> <artifactId>maven-surefire-report-plugin</artifactId>
<version>2.5</version> <version>2.11</version>
</plugin> </plugin>
</plugins> </plugins>
</reporting> </reporting>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* Description: CloudSim (Cloud Simulation) Toolkit for Modeling and Simulation of Clouds * Description: CloudSim (Cloud Simulation) Toolkit for Modeling and Simulation of Clouds
* Licence: GPL - http://www.gnu.org/copyleft/gpl.html * Licence: GPL - http://www.gnu.org/copyleft/gpl.html
* *
* Copyright (c) 2009-2010, The University of Melbourne, Australia * Copyright (c) 2009-2012, The University of Melbourne, Australia
*/ */
package org.cloudbus.cloudsim; package org.cloudbus.cloudsim;
...@@ -11,14 +11,13 @@ package org.cloudbus.cloudsim; ...@@ -11,14 +11,13 @@ package org.cloudbus.cloudsim;
import java.util.List; import java.util.List;
/** /**
* CloudletScheduler is an abstract class that represents the policy of * CloudletScheduler is an abstract class that represents the policy of scheduling performed by a
* scheduling performed by a virtual machine. So, classes * virtual machine. So, classes extending this must execute Cloudlets. Also, the interface for
* extending this must execute Cloudlets. Also, the interface for cloudlet * cloudlet management is also implemented in this class.
* management is also implemented in this class. *
* * @author Rodrigo N. Calheiros
* @author Rodrigo N. Calheiros * @author Anton Beloglazov
* @author Anton Beloglazov * @since CloudSim Toolkit 1.0
* @since CloudSim Toolkit 1.0
*/ */
public abstract class CloudletScheduler { public abstract class CloudletScheduler {
...@@ -29,9 +28,9 @@ public abstract class CloudletScheduler { ...@@ -29,9 +28,9 @@ public abstract class CloudletScheduler {
private List<Double> currentMipsShare; private List<Double> currentMipsShare;
/** /**
* Creates a new CloudletScheduler object. This method must be invoked * Creates a new CloudletScheduler object. This method must be invoked before starting the
* before starting the actual simulation. * actual simulation.
* *
* @pre $none * @pre $none
* @post $none * @post $none
*/ */
...@@ -41,13 +40,11 @@ public abstract class CloudletScheduler { ...@@ -41,13 +40,11 @@ public abstract class CloudletScheduler {
/** /**
* Updates the processing of cloudlets running under management of this scheduler. * Updates the processing of cloudlets running under management of this scheduler.
* *
* @param currentTime current simulation time * @param currentTime current simulation time
* @param mipsShare array with MIPS share of each processor available to the scheduler * @param mipsShare array with MIPS share of each processor available to the scheduler
* * @return time predicted completion time of the earliest finishing cloudlet, or 0 if there is no
* @return time predicted completion time of the earliest finishing cloudlet, or 0 * next events
* if there is no next events
*
* @pre currentTime >= 0 * @pre currentTime >= 0
* @post $none * @post $none
*/ */
...@@ -55,12 +52,10 @@ public abstract class CloudletScheduler { ...@@ -55,12 +52,10 @@ public abstract class CloudletScheduler {
/** /**
* Receives an cloudlet to be executed in the VM managed by this scheduler. * Receives an cloudlet to be executed in the VM managed by this scheduler.
* *
* @param gl the submited cloudlet * @param gl the submited cloudlet
* @param fileTransferTime time required to move the required files from the SAN to the VM * @param fileTransferTime time required to move the required files from the SAN to the VM
*
* @return expected finish time of this cloudlet, or 0 if it is in a waiting queue * @return expected finish time of this cloudlet, or 0 if it is in a waiting queue
*
* @pre gl != null * @pre gl != null
* @post $none * @post $none
*/ */
...@@ -68,11 +63,9 @@ public abstract class CloudletScheduler { ...@@ -68,11 +63,9 @@ public abstract class CloudletScheduler {
/** /**
* Receives an cloudlet to be executed in the VM managed by this scheduler. * Receives an cloudlet to be executed in the VM managed by this scheduler.
* *
* @param gl the submited cloudlet * @param gl the submited cloudlet
*
* @return expected finish time of this cloudlet, or 0 if it is in a waiting queue * @return expected finish time of this cloudlet, or 0 if it is in a waiting queue
*
* @pre gl != null * @pre gl != null
* @post $none * @post $none
*/ */
...@@ -80,11 +73,9 @@ public abstract class CloudletScheduler { ...@@ -80,11 +73,9 @@ public abstract class CloudletScheduler {
/** /**
* Cancels execution of a cloudlet. * Cancels execution of a cloudlet.
* *
* @param clId ID of the cloudlet being cancealed * @param clId ID of the cloudlet being cancealed
*
* @return the canceled cloudlet, $null if not found * @return the canceled cloudlet, $null if not found
*
* @pre $none * @pre $none
* @post $none * @post $none
*/ */
...@@ -92,11 +83,9 @@ public abstract class CloudletScheduler { ...@@ -92,11 +83,9 @@ public abstract class CloudletScheduler {
/** /**
* Pauses execution of a cloudlet. * Pauses execution of a cloudlet.
* *
* @param clId ID of the cloudlet being paused * @param clId ID of the cloudlet being paused
*
* @return $true if cloudlet paused, $false otherwise * @return $true if cloudlet paused, $false otherwise
*
* @pre $none * @pre $none
* @post $none * @post $none
*/ */
...@@ -104,11 +93,9 @@ public abstract class CloudletScheduler { ...@@ -104,11 +93,9 @@ public abstract class CloudletScheduler {
/** /**
* Resumes execution of a paused cloudlet. * Resumes execution of a paused cloudlet.
* *
* @param clId ID of the cloudlet being resumed * @param clId ID of the cloudlet being resumed
*
* @return expected finish time of the cloudlet, 0.0 if queued * @return expected finish time of the cloudlet, 0.0 if queued
*
* @pre $none * @pre $none
* @post $none * @post $none
*/ */
...@@ -116,9 +103,8 @@ public abstract class CloudletScheduler { ...@@ -116,9 +103,8 @@ public abstract class CloudletScheduler {
/** /**
* Processes a finished cloudlet. * Processes a finished cloudlet.
* *
* @param rcl finished cloudlet * @param rcl finished cloudlet
*
* @pre rgl != $null * @pre rgl != $null
* @post $none * @post $none
*/ */
...@@ -126,22 +112,18 @@ public abstract class CloudletScheduler { ...@@ -126,22 +112,18 @@ public abstract class CloudletScheduler {
/** /**
* Gets the status of a cloudlet. * Gets the status of a cloudlet.
* *
* @param clId ID of the cloudlet * @param clId ID of the cloudlet
*
* @return status of the cloudlet, -1 if cloudlet not found * @return status of the cloudlet, -1 if cloudlet not found
*
* @pre $none * @pre $none
* @post $none * @post $none
*/ */
public abstract int getCloudletStatus(int clId); public abstract int getCloudletStatus(int clId);
/** /**
* Informs about completion of some cloudlet in the VM managed * Informs about completion of some cloudlet in the VM managed by this scheduler.
* by this scheduler. *
*
* @return $true if there is at least one finished cloudlet; $false otherwise * @return $true if there is at least one finished cloudlet; $false otherwise
*
* @pre $none * @pre $none
* @post $none * @post $none
*/ */
...@@ -149,9 +131,8 @@ public abstract class CloudletScheduler { ...@@ -149,9 +131,8 @@ public abstract class CloudletScheduler {
/** /**
* Returns the next cloudlet in the finished list, $null if this list is empty. * Returns the next cloudlet in the finished list, $null if this list is empty.
* *
* @return a finished cloudlet * @return a finished cloudlet
*
* @pre $none * @pre $none
* @post $none * @post $none
*/ */
...@@ -159,9 +140,8 @@ public abstract class CloudletScheduler { ...@@ -159,9 +140,8 @@ public abstract class CloudletScheduler {
/** /**
* Returns the number of cloudlets runnning in the virtual machine. * Returns the number of cloudlets runnning in the virtual machine.
* *
* @return number of cloudlets runnning * @return number of cloudlets runnning
*
* @pre $none * @pre $none
* @post $none * @post $none
*/ */
...@@ -169,9 +149,8 @@ public abstract class CloudletScheduler { ...@@ -169,9 +149,8 @@ public abstract class CloudletScheduler {
/** /**
* Returns one cloudlet to migrate to another vm. * Returns one cloudlet to migrate to another vm.
* *
* @return one running cloudlet * @return one running cloudlet
*
* @pre $none * @pre $none
* @post $none * @post $none
*/ */
...@@ -179,67 +158,63 @@ public abstract class CloudletScheduler { ...@@ -179,67 +158,63 @@ public abstract class CloudletScheduler {
/** /**
* Get utilization created by all cloudlets. * Get utilization created by all cloudlets.
* *
* @param time the time * @param time the time
*
* @return total utilization * @return total utilization
*/ */
public abstract double getTotalUtilizationOfCpu(double time); public abstract double getTotalUtilizationOfCpu(double time);
/** /**
* Gets the current requested mips. * Gets the current requested mips.
* *
* @return the current mips * @return the current mips
*/ */
public abstract List<Double> getCurrentRequestedMips(); public abstract List<Double> getCurrentRequestedMips();
/** /**
* Gets the total current mips for the Cloudlet. * Gets the total current mips for the Cloudlet.
* *
* @param rcl the rcl * @param rcl the rcl
* @param mipsShare the mips share * @param mipsShare the mips share
*
* @return the total current mips * @return the total current mips
*/ */
public abstract double getTotalCurrentAvailableMipsForCloudlet(ResCloudlet rcl, List<Double> mipsShare); public abstract double getTotalCurrentAvailableMipsForCloudlet(ResCloudlet rcl, List<Double> mipsShare);
/** /**
* Gets the total current requested mips for cloudlet. * Gets the total current requested mips for cloudlet.
* *
* @param rcl the rcl * @param rcl the rcl
* @param time the time * @param time the time
*
* @return the total current requested mips for cloudlet * @return the total current requested mips for cloudlet
*/ */
public abstract double getTotalCurrentRequestedMipsForCloudlet(ResCloudlet rcl, double time); public abstract double getTotalCurrentRequestedMipsForCloudlet(ResCloudlet rcl, double time);
/** /**
* Gets the total current allocated mips for cloudlet. * Gets the total current allocated mips for cloudlet.
* *
* @param rcl the rcl * @param rcl the rcl
* @param time the time * @param time the time
*
* @return the total current allocated mips for cloudlet * @return the total current allocated mips for cloudlet
*/ */
public abstract double getTotalCurrentAllocatedMipsForCloudlet(ResCloudlet rcl, double time); public abstract double getTotalCurrentAllocatedMipsForCloudlet(ResCloudlet rcl, double time);
/** /**
* Gets the current requested ram. * Gets the current requested ram.
* *
* @return the current requested ram * @return the current requested ram
*/ */
public abstract double getCurrentRequestedUtilizationOfRam(); public abstract double getCurrentRequestedUtilizationOfRam();
/** /**
* Gets the current requested bw. * Gets the current requested bw.
* *
* @return the current requested bw * @return the current requested bw
*/ */
public abstract double getCurrentRequestedUtilizationOfBw(); public abstract double getCurrentRequestedUtilizationOfBw();
/** /**
* Gets the previous time. * Gets the previous time.
* *
* @return the previous time * @return the previous time
*/ */
public double getPreviousTime() { public double getPreviousTime() {
...@@ -248,7 +223,7 @@ public abstract class CloudletScheduler { ...@@ -248,7 +223,7 @@ public abstract class CloudletScheduler {
/** /**
* Sets the previous time. * Sets the previous time.
* *
* @param previousTime the new previous time * @param previousTime the new previous time
*/ */
protected void setPreviousTime(double previousTime) { protected void setPreviousTime(double previousTime) {
...@@ -257,7 +232,7 @@ public abstract class CloudletScheduler { ...@@ -257,7 +232,7 @@ public abstract class CloudletScheduler {
/** /**
* Sets the current mips share. * Sets the current mips share.
* *
* @param currentMipsShare the new current mips share * @param currentMipsShare the new current mips share
*/ */
protected void setCurrentMipsShare(List<Double> currentMipsShare) { protected void setCurrentMipsShare(List<Double> currentMipsShare) {
...@@ -266,7 +241,7 @@ public abstract class CloudletScheduler { ...@@ -266,7 +241,7 @@ public abstract class CloudletScheduler {
/** /**
* Gets the current mips share. * Gets the current mips share.
* *
* @return the current mips share * @return the current mips share
*/ */
public List<Double> getCurrentMipsShare() { public List<Double> getCurrentMipsShare() {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* Title: CloudSim Toolkit Description: CloudSim (Cloud Simulation) Toolkit for Modeling and * Title: CloudSim Toolkit Description: CloudSim (Cloud Simulation) Toolkit for Modeling and
* Simulation of Clouds Licence: GPL - http://www.gnu.org/copyleft/gpl.html * Simulation of Clouds Licence: GPL - http://www.gnu.org/copyleft/gpl.html
* *
* Copyright (c) 2009-2010, The University of Melbourne, Australia * Copyright (c) 2009-2012, The University of Melbourne, Australia
*/ */
package org.cloudbus.cloudsim; package org.cloudbus.cloudsim;
...@@ -59,10 +59,8 @@ public class CloudletSchedulerDynamicWorkload extends CloudletSchedulerTimeShare ...@@ -59,10 +59,8 @@ public class CloudletSchedulerDynamicWorkload extends CloudletSchedulerTimeShare
* *
* @param currentTime current simulation time * @param currentTime current simulation time
* @param mipsShare array with MIPS share of each Pe available to the scheduler * @param mipsShare array with MIPS share of each Pe available to the scheduler
*
* @return time predicted completion time of the earliest finishing cloudlet, or 0 if there is * @return time predicted completion time of the earliest finishing cloudlet, or 0 if there is
* no next events * no next events
*
* @pre currentTime >= 0 * @pre currentTime >= 0
* @post $none * @post $none
*/ */
...@@ -110,9 +108,7 @@ public class CloudletSchedulerDynamicWorkload extends CloudletSchedulerTimeShare ...@@ -110,9 +108,7 @@ public class CloudletSchedulerDynamicWorkload extends CloudletSchedulerTimeShare
* Receives an cloudlet to be executed in the VM managed by this scheduler. * Receives an cloudlet to be executed in the VM managed by this scheduler.
* *
* @param cl the cl * @param cl the cl
*
* @return predicted completion time * @return predicted completion time
*
* @pre _gl != null * @pre _gl != null
* @post $none * @post $none
*/ */
...@@ -126,9 +122,7 @@ public class CloudletSchedulerDynamicWorkload extends CloudletSchedulerTimeShare ...@@ -126,9 +122,7 @@ public class CloudletSchedulerDynamicWorkload extends CloudletSchedulerTimeShare
* *
* @param cl the cl * @param cl the cl
* @param fileTransferTime the file transfer time * @param fileTransferTime the file transfer time
*
* @return predicted completion time * @return predicted completion time
*
* @pre _gl != null * @pre _gl != null
* @post $none * @post $none
*/ */
...@@ -149,7 +143,6 @@ public class CloudletSchedulerDynamicWorkload extends CloudletSchedulerTimeShare ...@@ -149,7 +143,6 @@ public class CloudletSchedulerDynamicWorkload extends CloudletSchedulerTimeShare
* Processes a finished cloudlet. * Processes a finished cloudlet.
* *
* @param rcl finished cloudlet * @param rcl finished cloudlet
*
* @pre rgl != $null * @pre rgl != $null
* @post $none * @post $none
*/ */
...@@ -164,7 +157,6 @@ public class CloudletSchedulerDynamicWorkload extends CloudletSchedulerTimeShare ...@@ -164,7 +157,6 @@ public class CloudletSchedulerDynamicWorkload extends CloudletSchedulerTimeShare
* Get utilization created by all cloudlets. * Get utilization created by all cloudlets.
* *
* @param time the time * @param time the time
*
* @return total utilization * @return total utilization
*/ */
@Override @Override
...@@ -205,7 +197,6 @@ public class CloudletSchedulerDynamicWorkload extends CloudletSchedulerTimeShare ...@@ -205,7 +197,6 @@ public class CloudletSchedulerDynamicWorkload extends CloudletSchedulerTimeShare
* *
* @param rcl the rcl * @param rcl the rcl
* @param time the time * @param time the time
*
* @return the current mips * @return the current mips
*/ */
@Override @Override
...@@ -218,7 +209,6 @@ public class CloudletSchedulerDynamicWorkload extends CloudletSchedulerTimeShare ...@@ -218,7 +209,6 @@ public class CloudletSchedulerDynamicWorkload extends CloudletSchedulerTimeShare
* *
* @param rcl the rcl * @param rcl the rcl
* @param mipsShare the mips share * @param mipsShare the mips share
*
* @return the total current mips * @return the total current mips
*/ */
@Override @Override
...@@ -242,7 +232,6 @@ public class CloudletSchedulerDynamicWorkload extends CloudletSchedulerTimeShare ...@@ -242,7 +232,6 @@ public class CloudletSchedulerDynamicWorkload extends CloudletSchedulerTimeShare
* *
* @param rcl the rcl * @param rcl the rcl
* @param time the time * @param time the time
*
* @return the current mips * @return the current mips
*/ */
@Override @Override
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* Title: CloudSim Toolkit Description: CloudSim (Cloud Simulation) Toolkit for Modeling and * Title: CloudSim Toolkit Description: CloudSim (Cloud Simulation) Toolkit for Modeling and
* Simulation of Clouds Licence: GPL - http://www.gnu.org/copyleft/gpl.html * Simulation of Clouds Licence: GPL - http://www.gnu.org/copyleft/gpl.html
* *
* Copyright (c) 2009-2010, The University of Melbourne, Australia * Copyright (c) 2009-2012, The University of Melbourne, Australia
*/ */
package org.cloudbus.cloudsim; package org.cloudbus.cloudsim;
...@@ -65,7 +65,6 @@ public class Datacenter extends SimEntity { ...@@ -65,7 +65,6 @@ public class Datacenter extends SimEntity {
* @param characteristics an object of DatacenterCharacteristics * @param characteristics an object of DatacenterCharacteristics
* @param storageList a LinkedList of storage elements, for data simulation * @param storageList a LinkedList of storage elements, for data simulation
* @param vmAllocationPolicy the vmAllocationPolicy * @param vmAllocationPolicy the vmAllocationPolicy
*
* @throws Exception This happens when one of the following scenarios occur: * @throws Exception This happens when one of the following scenarios occur:
* <ul> * <ul>
* <li>creating this entity before initializing CloudSim package * <li>creating this entity before initializing CloudSim package
...@@ -74,7 +73,6 @@ public class Datacenter extends SimEntity { ...@@ -74,7 +73,6 @@ public class Datacenter extends SimEntity {
* No PEs mean the Cloudlets can't be processed. A CloudResource must contain one or * No PEs mean the Cloudlets can't be processed. A CloudResource must contain one or
* more Machines. A Machine must contain one or more PEs. * more Machines. A Machine must contain one or more PEs.
* </ul> * </ul>
*
* @pre name != null * @pre name != null
* @pre resource != null * @pre resource != null
* @post $none * @post $none
...@@ -124,14 +122,12 @@ public class Datacenter extends SimEntity { ...@@ -124,14 +122,12 @@ public class Datacenter extends SimEntity {
* Processes events or services that are available for this PowerDatacenter. * Processes events or services that are available for this PowerDatacenter.
* *
* @param ev a Sim_event object * @param ev a Sim_event object
*
* @pre ev != null * @pre ev != null
* @post $none * @post $none
*/ */
@Override @Override
public void processEvent(SimEvent ev) { public void processEvent(SimEvent ev) {
int srcId = -1; int srcId = -1;
// Log.printLine(CloudSim.clock()+"[PowerDatacenter]: event received:"+ev.getTag());
switch (ev.getTag()) { switch (ev.getTag()) {
// Resource characteristics inquiry // Resource characteristics inquiry
...@@ -357,7 +353,6 @@ public class Datacenter extends SimEntity { ...@@ -357,7 +353,6 @@ public class Datacenter extends SimEntity {
* Processes a ping request. * Processes a ping request.
* *
* @param ev a Sim_event object * @param ev a Sim_event object
*
* @pre ev != null * @pre ev != null
* @post $none * @post $none
*/ */
...@@ -375,7 +370,6 @@ public class Datacenter extends SimEntity { ...@@ -375,7 +370,6 @@ public class Datacenter extends SimEntity {
* PowerDatacenter will then send the status back to the User/Broker. * PowerDatacenter will then send the status back to the User/Broker.
* *
* @param ev a Sim_event object * @param ev a Sim_event object
*
* @pre ev != null * @pre ev != null
* @post $none * @post $none
*/ */
...@@ -430,7 +424,6 @@ public class Datacenter extends SimEntity { ...@@ -430,7 +424,6 @@ public class Datacenter extends SimEntity {
* method. * method.
* *
* @param ev the received event * @param ev the received event
*
* @pre $none * @pre $none
* @post $none * @post $none
*/ */
...@@ -446,7 +439,6 @@ public class Datacenter extends SimEntity { ...@@ -446,7 +439,6 @@ public class Datacenter extends SimEntity {
* *
* @param ev a Sim_event object * @param ev a Sim_event object
* @param ack the ack * @param ack the ack
*
* @pre ev != null * @pre ev != null
* @post $none * @post $none
*/ */
...@@ -497,7 +489,6 @@ public class Datacenter extends SimEntity { ...@@ -497,7 +489,6 @@ public class Datacenter extends SimEntity {
* *
* @param ev a Sim_event object * @param ev a Sim_event object
* @param ack the ack * @param ack the ack
*
* @pre ev != null * @pre ev != null
* @post $none * @post $none
*/ */
...@@ -581,7 +572,6 @@ public class Datacenter extends SimEntity { ...@@ -581,7 +572,6 @@ public class Datacenter extends SimEntity {
* *
* @param ev a Sim_event object * @param ev a Sim_event object
* @param type event type * @param type event type
*
* @pre ev != null * @pre ev != null
* @pre type > 0 * @pre type > 0
* @post $none * @post $none
...@@ -648,7 +638,6 @@ public class Datacenter extends SimEntity { ...@@ -648,7 +638,6 @@ public class Datacenter extends SimEntity {
* *
* @param receivedData information about the migration * @param receivedData information about the migration
* @param type event tag * @param type event tag
*
* @pre receivedData != null * @pre receivedData != null
* @pre type > 0 * @pre type > 0
* @post $none * @post $none
...@@ -690,11 +679,8 @@ public class Datacenter extends SimEntity { ...@@ -690,11 +679,8 @@ public class Datacenter extends SimEntity {
if (vm == null) { if (vm == null) {
failed = true; failed = true;
} else { } else {
double fileTransferTime = predictFileTransferTime(cl.getRequiredFiles()); // time // time to transfer the files
// to double fileTransferTime = predictFileTransferTime(cl.getRequiredFiles());
// transfer
// the
// files
vm.getCloudletScheduler().cloudletSubmit(cl, fileTransferTime); vm.getCloudletScheduler().cloudletSubmit(cl, fileTransferTime);
} }
} else {// the cloudlet will migrate from one resource to another } else {// the cloudlet will migrate from one resource to another
...@@ -722,7 +708,6 @@ public class Datacenter extends SimEntity { ...@@ -722,7 +708,6 @@ public class Datacenter extends SimEntity {
* *
* @param ev a SimEvent object * @param ev a SimEvent object
* @param ack an acknowledgement * @param ack an acknowledgement
*
* @pre ev != null * @pre ev != null
* @post $none * @post $none
*/ */
...@@ -769,29 +754,17 @@ public class Datacenter extends SimEntity { ...@@ -769,29 +754,17 @@ public class Datacenter extends SimEntity {
int userId = cl.getUserId(); int userId = cl.getUserId();
int vmId = cl.getVmId(); int vmId = cl.getVmId();
double fileTransferTime = predictFileTransferTime(cl.getRequiredFiles()); // time to // time to transfer the files
// transfer double fileTransferTime = predictFileTransferTime(cl.getRequiredFiles());
// the files
Host host = getVmAllocationPolicy().getHost(vmId, userId); Host host = getVmAllocationPolicy().getHost(vmId, userId);
Vm vm = host.getVm(vmId, userId); Vm vm = host.getVm(vmId, userId);
CloudletScheduler scheduler = vm.getCloudletScheduler(); CloudletScheduler scheduler = vm.getCloudletScheduler();
double estimatedFinishTime = scheduler.cloudletSubmit(cl, fileTransferTime); double estimatedFinishTime = scheduler.cloudletSubmit(cl, fileTransferTime);
// if (estimatedFinishTime > 0.0 && estimatedFinishTime < getSchedulingInterval()) { // if this cloudlet is in the exec queue
// //if this cloudlet is in the exec queue if (estimatedFinishTime > 0.0 && !Double.isInfinite(estimatedFinishTime)) {
if (estimatedFinishTime > 0.0 && !Double.isInfinite(estimatedFinishTime)) { // if this
// cloudlet
// is in the
// exec
// queue
// double estimatedFinishTime =
// (cl.getCloudletTotalLength()/(capacity*cl.getPesNumber())); //time to process the
// cloudlet
// Log.printLine(estimatedFinishTime+"="+gl.getCloudletLength()+"/("+capacity+"*"+gl.getNumPE()+")");
estimatedFinishTime += fileTransferTime; estimatedFinishTime += fileTransferTime;
// estimatedFinishTime += CloudSim.clock();
// Log.printLine(CloudSim.clock()+": Next event scheduled to +"+estimatedFinishTime);
send(getId(), estimatedFinishTime, CloudSimTags.VM_DATACENTER_EVENT); send(getId(), estimatedFinishTime, CloudSimTags.VM_DATACENTER_EVENT);
} }
...@@ -820,7 +793,6 @@ public class Datacenter extends SimEntity { ...@@ -820,7 +793,6 @@ public class Datacenter extends SimEntity {
* Predict file transfer time. * Predict file transfer time.
* *
* @param requiredFiles the required files * @param requiredFiles the required files
*
* @return the double * @return the double
*/ */
protected double predictFileTransferTime(List<String> requiredFiles) { protected double predictFileTransferTime(List<String> requiredFiles) {
...@@ -848,7 +820,6 @@ public class Datacenter extends SimEntity { ...@@ -848,7 +820,6 @@ public class Datacenter extends SimEntity {
* @param userId ID of the cloudlet's owner * @param userId ID of the cloudlet's owner
* @param ack $true if an ack is requested after operation * @param ack $true if an ack is requested after operation
* @param vmId the vm id * @param vmId the vm id
*
* @pre $none * @pre $none
* @post $none * @post $none
*/ */
...@@ -884,7 +855,6 @@ public class Datacenter extends SimEntity { ...@@ -884,7 +855,6 @@ public class Datacenter extends SimEntity {
* @param userId ID of the cloudlet's owner * @param userId ID of the cloudlet's owner
* @param ack $true if an ack is requested after operation * @param ack $true if an ack is requested after operation
* @param vmId the vm id * @param vmId the vm id
*
* @pre $none * @pre $none
* @post $none * @post $none
*/ */
...@@ -911,7 +881,6 @@ public class Datacenter extends SimEntity { ...@@ -911,7 +881,6 @@ public class Datacenter extends SimEntity {
* @param cloudletId resuming cloudlet ID * @param cloudletId resuming cloudlet ID
* @param userId ID of the cloudlet's owner * @param userId ID of the cloudlet's owner
* @param vmId the vm id * @param vmId the vm id
*
* @pre $none * @pre $none
* @post $none * @post $none
*/ */
...@@ -931,7 +900,6 @@ public class Datacenter extends SimEntity { ...@@ -931,7 +900,6 @@ public class Datacenter extends SimEntity {
* @post $none * @post $none
*/ */
protected void updateCloudletProcessing() { protected void updateCloudletProcessing() {
// Log.printLine(CloudSim.clock()+": PowerDatacenter #: updating cloudlet processing.......................................");
// if some time passed since last processing // if some time passed since last processing
// R: for term is to allow loop at simulation start. Otherwise, one initial // R: for term is to allow loop at simulation start. Otherwise, one initial
// simulation step is skipped and schedulers are not properly initialized // simulation step is skipped and schedulers are not properly initialized
...@@ -941,8 +909,8 @@ public class Datacenter extends SimEntity { ...@@ -941,8 +909,8 @@ public class Datacenter extends SimEntity {
// for each host... // for each host...
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
Host host = list.get(i); Host host = list.get(i);
double time = host.updateVmsProcessing(CloudSim.clock());// inform VMs to update // inform VMs to update processing
// processing double time = host.updateVmsProcessing(CloudSim.clock());
// what time do we expect that the next cloudlet will finish? // what time do we expect that the next cloudlet will finish?
if (time < smallerTime) { if (time < smallerTime) {
smallerTime = time; smallerTime = time;
...@@ -986,7 +954,6 @@ public class Datacenter extends SimEntity { ...@@ -986,7 +954,6 @@ public class Datacenter extends SimEntity {
* file, then it will be registered to the RC when the experiment begins. * file, then it will be registered to the RC when the experiment begins.
* *
* @param file a DataCloud file * @param file a DataCloud file
*
* @return a tag number denoting whether this operation is a success or not * @return a tag number denoting whether this operation is a success or not
*/ */
public int addFile(File file) { public int addFile(File file) {
...@@ -1022,7 +989,6 @@ public class Datacenter extends SimEntity { ...@@ -1022,7 +989,6 @@ public class Datacenter extends SimEntity {
* Checks whether the resource has the given file. * Checks whether the resource has the given file.
* *
* @param file a file to be searched * @param file a file to be searched
*
* @return <tt>true</tt> if successful, <tt>false</tt> otherwise * @return <tt>true</tt> if successful, <tt>false</tt> otherwise
*/ */
protected boolean contains(File file) { protected boolean contains(File file) {
...@@ -1036,7 +1002,6 @@ public class Datacenter extends SimEntity { ...@@ -1036,7 +1002,6 @@ public class Datacenter extends SimEntity {
* Checks whether the resource has the given file. * Checks whether the resource has the given file.
* *
* @param fileName a file name to be searched * @param fileName a file name to be searched
*
* @return <tt>true</tt> if successful, <tt>false</tt> otherwise * @return <tt>true</tt> if successful, <tt>false</tt> otherwise
*/ */
protected boolean contains(String fileName) { protected boolean contains(String fileName) {
...@@ -1064,7 +1029,6 @@ public class Datacenter extends SimEntity { ...@@ -1064,7 +1029,6 @@ public class Datacenter extends SimEntity {
* the storage. * the storage.
* *
* @param fileName the name of the file to be deleted * @param fileName the name of the file to be deleted
*
* @return the error message * @return the error message
*/ */
private int deleteFileFromStorage(String fileName) { private int deleteFileFromStorage(String fileName) {
...@@ -1102,7 +1066,6 @@ public class Datacenter extends SimEntity { ...@@ -1102,7 +1066,6 @@ public class Datacenter extends SimEntity {
/* /*
* (non-Javadoc) * (non-Javadoc)
*
* @see cloudsim.core.SimEntity#shutdownEntity() * @see cloudsim.core.SimEntity#shutdownEntity()
*/ */
@Override @Override
...@@ -1112,7 +1075,6 @@ public class Datacenter extends SimEntity { ...@@ -1112,7 +1075,6 @@ public class Datacenter extends SimEntity {
/* /*
* (non-Javadoc) * (non-Javadoc)
*
* @see cloudsim.core.SimEntity#startEntity() * @see cloudsim.core.SimEntity#startEntity()
*/ */
@Override @Override
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment