Unverified Commit 296ad797 authored by Manoel Campos's avatar Manoel Campos
Browse files

- Documentation update.


- Small refactoring.
Signed-off-by: default avatarManoel Campos <manoelcampos@gmail.com>
parent c7aa88c9
......@@ -16,7 +16,7 @@ Lists the main changes in the project.
- PowerHostUtilizationHistory class was removed and its single method getUtilizationHistory
was moved to the PowerHost. Since the method gets the history from VMs, the host
doesn't store any data. The VM utilization history must be enabled to allow
getting such data (as describe above).
getting such data (as described above).
- PowerHost class removed and its methods moved to Host.
A PowerSupply interface was introduced to group power
......
......@@ -57,7 +57,7 @@ CloudSim Plus provides a lot of exclusive features, from the most basic ones to
1. It is easier to use. A complete and easy-to-understand simulation scenario can be built in few lines of code. Check the [Examples Section](#a-minimal-and-complete-simulation-example);
1. [Vertical VM Scaling](/cloudsim-plus-examples/src/main/java/org/cloudsimplus/examples/autoscaling/VerticalVmCpuScalingExample.java) that performs on-demand up and down allocation of VM resources such as Ram, Bandwidth and PEs (CPUs) ([#7](https://github.com/manoelcampos/cloudsim-plus/issues/7));
1. [Horizontal VM scaling](/cloudsim-plus-examples/src/main/java/org/cloudsimplus/examples/autoscaling/LoadBalancerByHorizontalVmScalingExample.java), allowing dynamic creation of VMs according to an overload condition. Such a condition is defined by a predicate that checks different VM resources usage such as CPU, RAM or BW ([#41](https://github.com/manoelcampos/cloudsim-plus/issues/41));
1. Enables power-aware simulations using regular classes such as `DatacenterSimple`, `HostSimple` and `VmSimple`. This way, it automatically enables creating simulations that are both network- and power-aware by using the network version of such classes ([#45](https://github.com/manoelcampos/cloudsim-plus/issues/45));
1. Enables power-aware simulations using regular classes such as `DatacenterSimple`, `HostSimple` and `VmSimple`. This way, it automatically allows creation of simulations that are both power- and network-aware by using the network version of such classes ([#45](https://github.com/manoelcampos/cloudsim-plus/issues/45));
1. [Parallel execution of simulations](/cloudsim-plus-examples/src/main/java/org/cloudsimplus/examples/ParallelSimulationsExample.java), allowing several simulations to be run simultaneously, in a isolated way, inside a multi-core computer ([#38](https://github.com/manoelcampos/cloudsim-plus/issues/38));
1. Delay creation of submitted VMs and [Cloudlets](/cloudsim-plus-examples/src/main/java/org/cloudsimplus/examples/DynamicCloudletsArrival1.java), enabling simulation of dynamic arrival of tasks ([#11](https://github.com/manoelcampos/cloudsim-plus/issues/11), [#23](https://github.com/manoelcampos/cloudsim-plus/issues/23));
1. [Allow dynamic creation of VMs and Cloudlets without requiring creation of Datacenter Brokers at runtime](/cloudsim-plus-examples/src/main/java/org/cloudsimplus/examples/dynamic/DynamicCreationOfVmsAndCloudletsExample.java), enabling VMs to be created on-demand according to arrived cloudlets ([#43](https://github.com/manoelcampos/cloudsim-plus/issues/43));
......
......@@ -57,7 +57,7 @@ public abstract class VmAllocationPolicyMigrationDynamicUpperThresholdFirstFit e
/**
* Checks if a host is over utilized based on the CPU over utilization threshold computed using
* the statistical method defined in {@link VmAllocationPolicyMigrationDynamicUpperThreshold#computeHostUtilizationMeasure(Host)}.
* the statistical method defined in {@link #computeHostUtilizationMeasure(Host)}.
*
* @param host {@inheritDoc}
* @return {@inheritDoc}
......
......@@ -50,7 +50,11 @@ public class VmAllocationPolicyMigrationLocalRegressionRobust extends VmAllocati
* @param fallbackVmAllocationPolicy the fallback VM allocation policy to be used when
* the over utilization host detection doesn't have data to be computed
*/
public VmAllocationPolicyMigrationLocalRegressionRobust(PowerVmSelectionPolicy vmSelectionPolicy, double safetyParameter, VmAllocationPolicyMigration fallbackVmAllocationPolicy) {
public VmAllocationPolicyMigrationLocalRegressionRobust(
final PowerVmSelectionPolicy vmSelectionPolicy,
final double safetyParameter,
final VmAllocationPolicyMigration fallbackVmAllocationPolicy)
{
super(vmSelectionPolicy, safetyParameter, fallbackVmAllocationPolicy);
}
......@@ -61,7 +65,7 @@ public class VmAllocationPolicyMigrationLocalRegressionRobust extends VmAllocati
* @return the utilization estimates
*/
@Override
protected double[] getParameterEstimates(double[] reversedUsageHistory) {
protected double[] getParameterEstimates(final double[] reversedUsageHistory) {
return MathUtil.getRobustLoessParameterEstimates(reversedUsageHistory);
}
......
......@@ -32,9 +32,7 @@ final class VmAllocationPolicyMigrationNull implements VmAllocationPolicyMigrati
@Override public <T extends Host> List<T> getHostList() {
return Collections.emptyList();
}
@Override public Map<Vm, Host> getOptimizedAllocationMap(List<? extends Vm> vmList) {
return Collections.emptyMap();
}
@Override public Map<Vm, Host> getOptimizedAllocationMap(List<? extends Vm> vmList) { return Collections.emptyMap(); }
@Override public Map<Host, List<Double>> getUtilizationHistory() { return Collections.EMPTY_MAP; }
@Override public Map<Host, List<Double>> getMetricHistory() { return Collections.EMPTY_MAP; }
@Override public Map<Host, List<Double>> getTimeHistory() { return Collections.EMPTY_MAP; }
......
......@@ -30,8 +30,8 @@ import org.cloudbus.cloudsim.selectionpolicies.power.PowerVmSelectionPolicy;
*/
public class VmAllocationPolicyMigrationWorstFitStaticThreshold extends VmAllocationPolicyMigrationStaticThreshold {
public VmAllocationPolicyMigrationWorstFitStaticThreshold(
PowerVmSelectionPolicy vmSelectionPolicy,
double overUtilizationThreshold)
final PowerVmSelectionPolicy vmSelectionPolicy,
final double overUtilizationThreshold)
{
super(vmSelectionPolicy, overUtilizationThreshold);
}
......@@ -50,7 +50,7 @@ public class VmAllocationPolicyMigrationWorstFitStaticThreshold extends VmAlloca
* @return {@inheritDoc}
*/
@Override
protected Optional<Host> findHostForVmInternal(Vm vm, Stream<Host> hostStream) {
protected Optional<Host> findHostForVmInternal(final Vm vm, final Stream<Host> hostStream) {
/*It's ignoring the super class to intentionally avoid the additional filtering performed there
* and to apply a different method to select the Host to place the VM.*/
return hostStream.min(Comparator.comparingDouble(Host::getUtilizationOfCpuMips));
......
......@@ -8,15 +8,18 @@
package org.cloudbus.cloudsim.power.models;
import org.cloudbus.cloudsim.hosts.Host;
import org.cloudbus.cloudsim.power.supply.PowerSupply;
/**
* Provides a model for power consumption of hosts, depending on utilization of a critical system
* component, such as CPU.
* <b>This is the fundamental class to enable power-aware Hosts.</b> Despite all Hosts have a {@link PowerSupply} attribute,
* it just provides power usage data if a PowerModel is set using the {@link PowerSupply#setPowerModel(PowerModel)}.
*
* The interface implements the Null Object
* <p>The interface implements the Null Object
* Design Pattern in order to start avoiding {@link NullPointerException} when
* using the {@link PowerModel#NULL} object instead of attributing {@code null} to
* {@link PowerModel} variables.
* {@link PowerModel} variables.</p>
*
* <p>If you are using any algorithms, policies or workload included in the
* power package please cite the following paper:</p>
......@@ -31,6 +34,7 @@ import org.cloudbus.cloudsim.hosts.Host;
* </ul>
*
* @author Anton Beloglazov
* @author Manoel Campos da Silva Filho
*
* @since CloudSim Toolkit 2.0
*/
......
......@@ -6,11 +6,11 @@ import org.cloudbus.cloudsim.power.models.PowerModel;
import java.util.Objects;
/**
* Provides information about a PM power consumption,
* including its {@link PowerModel}.
* Provides data about a PM power consumption,
* according to a defined {@link PowerModel}.
*
* @author Anton Beloglazov
* @author Manoel Campos da Silva Filho
* @author Anton Beloglazov
* @since CloudSim Plus 1.4
*/
public class HostPowerSupply implements PowerSupply {
......@@ -59,7 +59,11 @@ public class HostPowerSupply implements PowerSupply {
}
@Override
public double getEnergyLinearInterpolation(final double fromUtilization, final double toUtilization, final double time) {
public double getEnergyLinearInterpolation(
final double fromUtilization,
final double toUtilization,
final double time)
{
if (fromUtilization == 0) {
return 0;
}
......
......@@ -5,17 +5,17 @@ import org.cloudbus.cloudsim.power.models.PowerModel;
import org.cloudbus.cloudsim.resources.Pe;
/**
* Provides information about a PM power consumption,
* including its {@link PowerModel}.
* Power information is just available if a {@link PowerModel}
* Provides data about a PM power consumption,
* according to a defined {@link PowerModel}.
* Power consumption data is just available if a {@link PowerModel}
* is set to the PowerSupply.
*
* <p><b>It's required to set a {@link PowerModel} in order to get any power usage data
* using the available methods. A {@link PowerModel} don't need to be set
* you don't want to simulate power consumption.</b></p>
*
* @author Anton Beloglazov
* @author Manoel Campos da Silva Filho
* @author Anton Beloglazov
* @since CloudSim Plus 1.4
*/
public interface PowerSupply {
......
......@@ -11,7 +11,7 @@ import org.cloudbus.cloudsim.power.models.PowerModel;
* @since CloudSim Plus 1.4
* @see PowerSupply#NULL
*/
class PowerSupplyNull implements PowerSupply {
final class PowerSupplyNull implements PowerSupply {
@Override public double getPower() {
return 0;
}
......
/**
* Provides classes and interfaces enabling a {@link org.cloudbus.cloudsim.hosts.Host}
* to compute power consumption using a {@link org.cloudbus.cloudsim.power.supply.PowerSupply}
* that follows a {@link org.cloudbus.cloudsim.power.models.PowerModel}.
* to be power-aware.
* Every host nas a {@link org.cloudbus.cloudsim.power.supply.PowerSupply} instance
* that might define power consumption following a {@link org.cloudbus.cloudsim.power.models.PowerModel}.
* However, a Host just provides power usage data if a {@link org.cloudbus.cloudsim.power.models.PowerModel} is set.
*
* <p>CloudSim Plus natively supports power-aware simulations
* using regular objects such as {@link org.cloudbus.cloudsim.datacenters.DatacenterSimple},
......
......@@ -11,7 +11,7 @@ import java.util.List;
* @since CloudSim Plus 1.4
* @see UtilizationHistory#NULL
*/
class UtilizationHistoryNull implements UtilizationHistory {
final class UtilizationHistoryNull implements UtilizationHistory {
@Override public double getUtilizationMad() { return 0; }
@Override public double getUtilizationMean() { return 0; }
@Override public double getUtilizationVariance() { return 0; }
......
......@@ -168,7 +168,7 @@ public class VmSimple implements Vm {
this.setBwVerticalScaling(VerticalVmScaling.NULL);
this.setPeVerticalScaling(VerticalVmScaling.NULL);
//By default, the VM doesn't store utilization history. This has be enabled by the user as wanted
//By default, the VM doesn't store utilization history. This has to be enabled by the user as wanted
utilizationHistory = new VmUtilizationHistory(this, false);
}
......
......@@ -9,6 +9,7 @@ import java.util.List;
/**
* Stores resource utilization data for a specific {@link Vm}.
*
* @author Anton Beloglazov
* @author Manoel Campos da Silva Filho
* @since CloudSim Plus 1.4
*/
......
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