Commit 5c2b0614 authored by Manoel Campos's avatar Manoel Campos
Browse files

Updated docs for version 1.1.0 and created new tag.

parent f17e1649
......@@ -355,6 +355,12 @@ getRequiredFiles
:return: the required files
getResponseTime
^^^^^^^^^^^^^^^
.. java:method:: double getResponseTime()
:outertype: Cloudlet
getSimulation
^^^^^^^^^^^^^
......
......@@ -238,6 +238,12 @@ getRequiredFiles
.. java:method:: @Override public List<String> getRequiredFiles()
:outertype: CloudletAbstract
getResponseTime
^^^^^^^^^^^^^^^
.. java:method:: @Override public double getResponseTime()
:outertype: CloudletAbstract
getSimulation
^^^^^^^^^^^^^
......
......@@ -169,7 +169,7 @@ getId
getMips
^^^^^^^
.. java:method:: int getMips()
.. java:method:: long getMips()
:outertype: DatacenterCharacteristics
Gets the total MIPS rating, which is the sum of MIPS rating of all Hosts in the Datacenter.
......@@ -179,7 +179,7 @@ getMips
getMipsOfOnePe
^^^^^^^^^^^^^^
.. java:method:: int getMipsOfOnePe(int hostId, int peId)
.. java:method:: long getMipsOfOnePe(int hostId, int peId)
:outertype: DatacenterCharacteristics
Gets Millions Instructions Per Second (MIPS) Rating of a Processing Element (Pe). It is essential to use this method when a Datacenter is made up of heterogenous PEs per PMs.
......
......@@ -119,13 +119,13 @@ getId
getMips
^^^^^^^
.. java:method:: @Override public int getMips()
.. java:method:: @Override public long getMips()
:outertype: DatacenterCharacteristicsSimple
getMipsOfOnePe
^^^^^^^^^^^^^^
.. java:method:: @Override public int getMipsOfOnePe(int hostId, int peId)
.. java:method:: @Override public long getMipsOfOnePe(int hostId, int peId)
:outertype: DatacenterCharacteristicsSimple
getNumberOfBusyPes
......
......@@ -271,7 +271,7 @@ getTotalAllocatedMipsForVm
getTotalMips
^^^^^^^^^^^^
.. java:method:: int getTotalMips()
.. java:method:: long getTotalMips()
:outertype: Host
Gets the total mips.
......
......@@ -257,7 +257,7 @@ getTotalAllocatedMipsForVm
getTotalMips
^^^^^^^^^^^^
.. java:method:: @Override public int getTotalMips()
.. java:method:: @Override public long getTotalMips()
:outertype: HostSimple
getVm
......
......@@ -2,8 +2,6 @@
.. java:import:: org.cloudbus.cloudsim.provisioners PeProvisioner
.. java:import:: org.cloudbus.cloudsim.util Log
.. java:import:: org.cloudbus.cloudsim.resources Pe
.. java:import:: org.cloudbus.cloudsim.vms Vm
......@@ -72,7 +70,7 @@ getMaxUtilizationAmongVmsPes
getMips
^^^^^^^
.. java:method:: public static int getMips(List<? extends Pe> peList, int id)
.. java:method:: public static long getMips(List<? extends Pe> peList, int id)
:outertype: PeList
Gets MIPS Rating of a PE with a given ID.
......@@ -106,7 +104,7 @@ getNumberOfFreePes
getTotalMips
^^^^^^^^^^^^
.. java:method:: public static int getTotalMips(List<? extends Pe> peList)
.. java:method:: public static long getTotalMips(List<? extends Pe> peList)
:outertype: PeList
Gets total MIPS Rating for all PEs.
......
......@@ -4,6 +4,12 @@
.. java:import:: java.util Objects
.. java:import:: org.cloudbus.cloudsim.resources Bandwidth
.. java:import:: org.cloudbus.cloudsim.resources Pe
.. java:import:: org.cloudbus.cloudsim.resources Ram
.. java:import:: org.cloudbus.cloudsim.vms Vm
.. java:import:: org.cloudbus.cloudsim.resources ResourceManageable
......@@ -27,6 +33,14 @@ Constructors
AbstractResourceProvisioner
^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. java:constructor:: protected AbstractResourceProvisioner()
:outertype: AbstractResourceProvisioner
Creates a new ResourceManageable Provisioner for which the \ :java:ref:`resource <getResource()>`\ must be set further.
AbstractResourceProvisioner
^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. java:constructor:: public AbstractResourceProvisioner(ResourceManageable resource)
:outertype: AbstractResourceProvisioner
......@@ -77,7 +91,9 @@ getResource
.. java:method:: protected ResourceManageable getResource()
:outertype: AbstractResourceProvisioner
:return: the resource
Gets the resource being managed for the provisioner, such as \ :java:ref:`Ram`\ , \ :java:ref:`Pe`\ , \ :java:ref:`Bandwidth`\ , etc.
:return: the resource managed by this provisioner
getResourceAllocationMap
^^^^^^^^^^^^^^^^^^^^^^^^
......@@ -85,7 +101,9 @@ getResourceAllocationMap
.. java:method:: protected Map<Vm, Long> getResourceAllocationMap()
:outertype: AbstractResourceProvisioner
:return: the resourceAllocationMap
Gets the VM resource allocation map, where each key is a VM and each value is the amount of resource allocated to that VM.
:return: the resource allocation Map
getResourceClass
^^^^^^^^^^^^^^^^
......@@ -93,7 +111,9 @@ getResourceClass
.. java:method:: protected Class<? extends ResourceManageable> getResourceClass()
:outertype: AbstractResourceProvisioner
:return: the resourceClass
Gets the class of the resource that this provisioner manages.
:return: the resource class
getTotalAllocatedResource
^^^^^^^^^^^^^^^^^^^^^^^^^
......@@ -101,3 +121,9 @@ getTotalAllocatedResource
.. java:method:: @Override public long getTotalAllocatedResource()
:outertype: AbstractResourceProvisioner
setResource
^^^^^^^^^^^
.. java:method:: protected final void setResource(ResourceManageable resource)
:outertype: AbstractResourceProvisioner
.. java:import:: java.util List
.. java:import:: org.cloudbus.cloudsim.datacenters DatacenterCharacteristics
.. java:import:: org.cloudbus.cloudsim.resources Pe
.. java:import:: org.cloudbus.cloudsim.vms Vm
......@@ -12,159 +8,92 @@ PeProvisioner
.. java:package:: org.cloudbus.cloudsim.provisioners
:noindex:
.. java:type:: public abstract class PeProvisioner
.. java:type:: public interface PeProvisioner extends ResourceProvisioner
/** PeProvisioner is an abstract class that represents the provisioning policy used by a host to allocate its PEs to virtual machines inside it. It gets a physical PE and manage it in order to provide this PE as virtual PEs for VMs. In that way, a given PE might be shared among different VMs. Each host's PE has to have its own instance of a PeProvisioner. When extending this class, care must be taken to guarantee that the field availableMips will always contain the amount of free mipsCapacity available for future allocations.
A class that represents the provisioning policy used by a host to allocate its PEs to virtual machines inside it. It gets a physical PE and manage it in order to provide this PE as virtual PEs for VMs. In that way, a given PE might be shared among different VMs.
:author: Anton Beloglazov
:author: Manoel Campos da Silva Filho
Constructors
------------
PeProvisioner
^^^^^^^^^^^^^
Fields
------
NULL
^^^^
.. java:constructor:: public PeProvisioner(double mipsCapacity)
.. java:field:: PeProvisioner NULL
:outertype: PeProvisioner
Creates a new PeProvisioner.
:param mipsCapacity: The total mipsCapacity capacity of the PE that the provisioner can allocate to VMs
A property that implements the Null Object Design Pattern for PeProvisioner objects.
Methods
-------
allocateMipsForVm
^^^^^^^^^^^^^^^^^
allocateResourceForVm
^^^^^^^^^^^^^^^^^^^^^
.. java:method:: public abstract boolean allocateMipsForVm(Vm vm, double mips)
.. java:method:: @Override boolean allocateResourceForVm(Vm vm, long mips)
:outertype: PeProvisioner
Allocates a new virtual PE with a specific capacity for a given VM. The virtual PE to be added will use the total or partial mipsCapacity capacity of the physical PE.
Allocates an amount of MIPS from the physical Pe to a new virtual PE for a given VM. The virtual PE to be added will use the total or partial MIPS capacity of the physical PE.
:param vm: the virtual machine for which the new virtual PE is being allocated
:param mips: the mipsCapacity to be allocated to the virtual PE of the given VM
:param mips: the MIPS to be allocated to the virtual PE of the given VM
:return: $true if the virtual PE could be allocated; $false otherwise
allocateMipsForVm
^^^^^^^^^^^^^^^^^
.. java:method:: public abstract boolean allocateMipsForVm(Vm vm, List<Double> mips)
:outertype: PeProvisioner
Allocates a new set of virtual PEs with a specific capacity for a given VM. The virtual PE to be added will use the total or partial mipsCapacity capacity of the physical PE.
:param vm: the virtual machine for which the new virtual PE is being allocated
:param mips: the list of mipsCapacity capacity of each virtual PE to be allocated to the VM
:return: $true if the set of virtual PEs could be allocated; $false otherwise
deallocateMipsForAllVms
^^^^^^^^^^^^^^^^^^^^^^^
deallocateResourceForAllVms
^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. java:method:: public void deallocateMipsForAllVms()
.. java:method:: @Override void deallocateResourceForAllVms()
:outertype: PeProvisioner
Releases all virtual PEs allocated to all VMs.
deallocateMipsForVm
^^^^^^^^^^^^^^^^^^^
.. java:method:: public abstract void deallocateMipsForVm(Vm vm)
:outertype: PeProvisioner
Releases all virtual PEs allocated to a given VM.
:param vm: the vm
getAllocatedMipsForVm
^^^^^^^^^^^^^^^^^^^^^
.. java:method:: public abstract List<Double> getAllocatedMipsForVm(Vm vm)
:outertype: PeProvisioner
Gets the list of allocated virtual PEs' MIPS for a given VM.
:param vm: the virtual machine the get the list of allocated virtual PEs' MIPS
:return: list of allocated virtual PEs' MIPS
getAllocatedMipsForVmByVirtualPeId
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
deallocateResourceForVm
^^^^^^^^^^^^^^^^^^^^^^^
.. java:method:: public abstract double getAllocatedMipsForVmByVirtualPeId(Vm vm, int peId)
.. java:method:: @Override boolean deallocateResourceForVm(Vm vm)
:outertype: PeProvisioner
Gets the MIPS capacity of a virtual Pe allocated to a given VM.
Releases the virtual Pe allocated to a given VM.
:param vm: virtual machine to get a given virtual PE capacity
:param peId: the virtual pe id
:return: allocated MIPS for the virtual PE
:param vm: the vm to release the virtual Pe
getAvailableMips
^^^^^^^^^^^^^^^^
getAllocatedResourceForVm
^^^^^^^^^^^^^^^^^^^^^^^^^
.. java:method:: public double getAvailableMips()
.. java:method:: @Override long getAllocatedResourceForVm(Vm vm)
:outertype: PeProvisioner
Gets the available MIPS in the PE.
:return: available MIPS
Gets the amount of allocated MIPS from the physical Pe to a virtual PE of a VM.
getMipsCapacity
^^^^^^^^^^^^^^^
:param vm: the virtual machine to get the allocated virtual Pe MIPS
:return: the allocated virtual Pe MIPS
.. java:method:: public double getMipsCapacity()
:outertype: PeProvisioner
Gets the total MIPS capacity of the PE that the provisioner can allocate to VMs.
getTotalAllocatedResource
^^^^^^^^^^^^^^^^^^^^^^^^^
getTotalAllocatedMips
^^^^^^^^^^^^^^^^^^^^^
.. java:method:: public double getTotalAllocatedMips()
.. java:method:: @Override long getTotalAllocatedResource()
:outertype: PeProvisioner
Gets the total allocated MIPS.
Gets the total allocated MIPS from the physical Pe.
:return: the total allocated MIPS
getTotalAllocatedMipsForVm
^^^^^^^^^^^^^^^^^^^^^^^^^^
.. java:method:: public abstract double getTotalAllocatedMipsForVm(Vm vm)
:outertype: PeProvisioner
Gets total allocated MIPS for a given VM for all PEs.
:param vm: the virtual machine the get the total allocated MIPS capacity
:return: total allocated MIPS
getUtilization
^^^^^^^^^^^^^^
.. java:method:: public double getUtilization()
:outertype: PeProvisioner
Gets the utilization of the Pe in percents.
:return: the utilization
setAvailableMips
^^^^^^^^^^^^^^^^
.. java:method:: protected final boolean setAvailableMips(double availableMips)
.. java:method:: double getUtilization()
:outertype: PeProvisioner
Sets the available MIPS in the PE.
Gets the utilization percentage of the Pe in scale from 0 to 1.
:param availableMips: the availableMips to set
:return: true if availableMips >= 0, false otherwise
:return: the utilization percentage from 0 to 1
setMipsCapacity
^^^^^^^^^^^^^^^
setPe
^^^^^
.. java:method:: public final boolean setMipsCapacity(double mipsCapacity)
.. java:method:: void setPe(Pe pe)
:outertype: PeProvisioner
Sets the total MIPS capacity of the PE that the provisioner can allocate to VMs.
Sets the \ :java:ref:`Pe`\ that this provisioner will manage.
:param mipsCapacity: the MIPS capacity to set
:return: true if mipsCapacity > 0, false otherwise
:param pe: the Pe to set
.. java:import:: java.util ArrayList
.. java:import:: java.util HashMap
.. java:import:: java.util List
.. java:import:: java.util Map
.. java:import:: org.cloudbus.cloudsim.resources Pe
.. java:import:: org.cloudbus.cloudsim.vms Vm
......@@ -14,85 +8,43 @@ PeProvisionerSimple
.. java:package:: org.cloudbus.cloudsim.provisioners
:noindex:
.. java:type:: public class PeProvisionerSimple extends PeProvisioner
.. java:type:: public class PeProvisionerSimple extends ResourceProvisionerSimple implements PeProvisioner
A \ :java:ref:`PeProvisioner`\ that uses a best-effort policy to allocate virtual PEs to VMs from a physical PE: if there is available MIPS on the physical PE, it allocates to a virtual PE; otherwise, it fails. Each host's PE has to have its own instance of a PeProvisioner.
PeProvisionerSimple is an extension of \ :java:ref:`PeProvisioner`\ which uses a best-effort policy to allocate virtual PEs to VMs: if there is available MIPS on the physical PE, it allocates to a virtual PE; otherwise, it fails. Each host's PE has to have its own instance of a PeProvisioner.
Each host's PE must have its own instance of a PeProvisioner. When extending this class, care must be taken to guarantee that the field availableMips will always contain the amount of free MIPS available for future allocations.
:author: Anton Beloglazov
:author: Anton Beloglazov, Manoel Campos da Silva Filho
Constructors
------------
PeProvisionerSimple
^^^^^^^^^^^^^^^^^^^
.. java:constructor:: public PeProvisionerSimple(double availableMips)
:outertype: PeProvisionerSimple
Instantiates a new pe provisioner simple.
:param availableMips: The total mips capacity of the PE that the provisioner can allocate to VMs.
Methods
-------
allocateMipsForVm
^^^^^^^^^^^^^^^^^
.. java:method:: @Override public boolean allocateMipsForVm(Vm vm, double mips)
:outertype: PeProvisionerSimple
allocateMipsForVm
^^^^^^^^^^^^^^^^^
.. java:method:: @Override public boolean allocateMipsForVm(Vm vm, List<Double> mipsShare)
.. java:constructor:: public PeProvisionerSimple()
:outertype: PeProvisionerSimple
deallocateMipsForAllVms
^^^^^^^^^^^^^^^^^^^^^^^
.. java:method:: @Override public void deallocateMipsForAllVms()
:outertype: PeProvisionerSimple
Instantiates a new PeProvisionerSimple that the \ :java:ref:`Pe`\ it will manage will be set just at Pe instantiation.
deallocateMipsForVm
PeProvisionerSimple
^^^^^^^^^^^^^^^^^^^
.. java:method:: @Override public void deallocateMipsForVm(Vm vm)
:outertype: PeProvisionerSimple
getAllocatedMipsForVm
^^^^^^^^^^^^^^^^^^^^^
.. java:method:: @Override public List<Double> getAllocatedMipsForVm(Vm vm)
.. java:constructor:: public PeProvisionerSimple(Pe pe)
:outertype: PeProvisionerSimple
getAllocatedMipsForVmByVirtualPeId
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Instantiates a new PeProvisionerSimple for a given \ :java:ref:`Pe`\ .
.. java:method:: @Override public double getAllocatedMipsForVmByVirtualPeId(Vm vm, int peId)
:outertype: PeProvisionerSimple
getPeTable
^^^^^^^^^^
.. java:method:: protected Map<Vm, List<Double>> getPeTable()
:outertype: PeProvisionerSimple
Gets the pe map.
:return: the pe map
getTotalAllocatedMipsForVm
^^^^^^^^^^^^^^^^^^^^^^^^^^
Methods
-------
getUtilization
^^^^^^^^^^^^^^
.. java:method:: @Override public double getTotalAllocatedMipsForVm(Vm vm)
.. java:method:: @Override public double getUtilization()
:outertype: PeProvisionerSimple
setPeTable
^^^^^^^^^^
setPe
^^^^^
.. java:method:: protected final void setPeTable(Map<Vm, List<Double>> peTable)
.. java:method:: @Override public void setPe(Pe pe)
:outertype: PeProvisionerSimple
Sets the pe map.
:param peTable: the peTable to set
......@@ -2,6 +2,8 @@
.. java:import:: org.cloudbus.cloudsim.resources ResourceManageable
.. java:import:: java.util Objects
ResourceProvisionerSimple
=========================
......@@ -22,9 +24,9 @@ ResourceProvisionerSimple
.. java:constructor:: public ResourceProvisionerSimple(ResourceManageable resource)
:outertype: ResourceProvisionerSimple
Creates a new ResourceManageable Provisioner.
Creates a new ResourceProvisionerSimple.
:param resource: The resource to be managed by the provisioner
:param resource: the resource to be managed by the provisioner
Methods
-------
......
.. java:import:: org.cloudbus.cloudsim.core Identificable
.. java:import:: org.cloudbus.cloudsim.provisioners PeProvisioner
.. java:import:: org.cloudbus.cloudsim.provisioners PeProvisionerSimple
......
.. java:import:: org.cloudbus.cloudsim.core Identificable
.. java:import:: org.cloudbus.cloudsim.provisioners PeProvisioner
.. java:import:: org.cloudbus.cloudsim.provisioners PeProvisionerSimple
......@@ -8,7 +10,7 @@ Pe
.. java:package:: org.cloudbus.cloudsim.resources
:noindex:
.. java:type:: public interface Pe
.. java:type:: public interface Pe extends Identificable, ResourceManageable
A interface to be implemented by each class that provides the basic features of a virtual or physical Processing Element (PE) of a PM or VM. Each Pe represents a virtual or physical processor core.
......@@ -24,29 +26,19 @@ NULL
.. java:field:: Pe NULL
:outertype: Pe
A property that implements the Null Object Design Pattern for \ :java:ref:`Pe`\ objects.
An attribute that implements the Null Object Design Pattern for \ :java:ref:`Pe`\ objects.
Methods
-------
getId
^^^^^
.. java:method:: int getId()
:outertype: Pe
Gets the PE id.
:return: the PE id
getMips
^^^^^^^
getCapacity
^^^^^^^^^^^
.. java:method:: int getMips()
.. java:method:: @Override long getCapacity()
:outertype: Pe
Gets the MIPS Rating of this Pe.
Gets the capacity of this Pe in MIPS (Million Instructions Per Second).
:return: the MIPS Rating
:return: the MIPS capacity
getPeProvisioner
^^^^^^^^^^^^^^^^
......@@ -68,16 +60,49 @@ getStatus
:return: the PE status
setMips
^^^^^^^
setCapacity
^^^^^^^^^^^
.. java:method:: @Override boolean setCapacity(long mipsCapacity)
:outertype: Pe
Sets the capacity of this Pe in MIPS (Million Instructions Per Second).
:param mipsCapacity: the MIPS capacity to set
:return: true if mipsCapacity > 0, false otherwise
setCapacity
^^^^^^^^^^^
.. java:method:: boolean setCapacity(double mipsCapacity)
:outertype: Pe
Sets the capacity of this Pe in MIPS (Million Instructions Per Second).
It receives the amount of MIPS as a double value but converts it internally to a long. The method is just provided as a handy-way to define the PE capacity using a double value that usually is generated from some computations.
:param mipsCapacity: the MIPS capacity to set
:return: true if mipsCapacity > 0, false otherwise
setId
^^^^^
.. java:method:: void setId(int id)
:outertype: Pe
Sets the \ :java:ref:`getId()`\ .
:param id: the new PE id
setPeProvisioner
^^^^^^^^^^^^^^^^
.. java:method:: boolean setMips(double d)
.. java:method:: Pe setPeProvisioner(PeProvisioner peProvisioner)