Class CloudletAbstract

java.lang.Object
org.cloudbus.cloudsim.core.CustomerEntityAbstract
org.cloudbus.cloudsim.cloudlets.CloudletAbstract
All Implemented Interfaces:
Comparable<Cloudlet>, Cloudlet, ChangeableId, CustomerEntity, Delayable, Identifiable, UniquelyIdentifiable
Direct Known Subclasses:
CloudletSimple

public abstract class CloudletAbstract extends CustomerEntityAbstract implements Cloudlet
An abstract class for Cloudlet implementations.
Author:
Rodrigo N. Calheiros, Anton Beloglazov, Manoel Campos da Silva Filho
  • Constructor Details

    • CloudletAbstract

      public CloudletAbstract(long length, int pesNumber, UtilizationModel utilizationModel)
      Creates a Cloudlet with no priority or id. The id is defined when the Cloudlet is submitted to a DatacenterBroker. The file size and output size is defined as 1.
      Parameters:
      length - the length or size (in MI) of this cloudlet to be executed in a VM (check out setLength(long))
      pesNumber - number of PEs that Cloudlet will require
      utilizationModel - a UtilizationModel to define how the Cloudlet uses CPU, RAM and BW. To define an independent utilization model for each resource, call the respective setters.
      See Also:
    • CloudletAbstract

      public CloudletAbstract(long length, int pesNumber)
      Creates a Cloudlet with no priority or id. The id is defined when the Cloudlet is submitted to a DatacenterBroker. The file size and output size is defined as 1.

      NOTE: By default, the Cloudlet will use a UtilizationModelFull to define CPU utilization and a UtilizationModel.NULL for RAM and BW. To change the default values, use the respective setters.

      Parameters:
      length - the length or size (in MI) of this cloudlet to be executed in a VM (check out setLength(long))
      pesNumber - number of PEs that Cloudlet will require
    • CloudletAbstract

      public CloudletAbstract(long length, long pesNumber)
      Creates a Cloudlet with no priority or id. The id is defined when the Cloudlet is submitted to a DatacenterBroker. The file size and output size is defined as 1.

      NOTE: By default, the Cloudlet will use a UtilizationModelFull to define CPU utilization and a UtilizationModel.NULL for RAM and BW. To change the default values, use the respective setters.

      Parameters:
      length - the length or size (in MI) of this cloudlet to be executed in a VM (check out setLength(long))
      pesNumber - number of PEs that Cloudlet will require
    • CloudletAbstract

      public CloudletAbstract(long id, long length, long pesNumber)
      Creates a Cloudlet with no priority, file size and output size equal to 1.

      NOTE: By default, the Cloudlet will use a UtilizationModelFull to define CPU utilization and a UtilizationModel.NULL for RAM and BW. To change the default values, use the respective setters.

      Parameters:
      id - id of the Cloudlet
      length - the length or size (in MI) of this cloudlet to be executed in a VM (check out setLength(long))
      pesNumber - number of PEs that Cloudlet will require
  • Method Details

    • reset

      public final Cloudlet reset()
      Description copied from interface: Cloudlet
      Resets the state of the Cloudlet.
      Specified by:
      reset in interface Cloudlet
      Returns:
    • getLastExecutedDatacenterIdx

      protected int getLastExecutedDatacenterIdx()
    • setLastExecutedDatacenterIdx

      protected void setLastExecutedDatacenterIdx(int lastExecutedDatacenterIdx)
    • setUtilizationModel

      public Cloudlet setUtilizationModel(UtilizationModel utilizationModel)
      Description copied from interface: Cloudlet
      Sets the same utilization model for defining the usage of Bandwidth, CPU and RAM. To set different utilization models for each one of these resources, use the respective setters.
      Specified by:
      setUtilizationModel in interface Cloudlet
      Parameters:
      utilizationModel - the new utilization model for BW, CPU and RAM
      Returns:
      See Also:
    • addOnUpdateProcessingListener

      public Cloudlet addOnUpdateProcessingListener(EventListener<CloudletVmEventInfo> listener)
      Description copied from interface: Cloudlet
      Adds a Listener object that will be notified every time the processing of the Cloudlet is updated in its Vm.
      Specified by:
      addOnUpdateProcessingListener in interface Cloudlet
      Parameters:
      listener - the listener to add
      See Also:
    • removeOnUpdateProcessingListener

      public boolean removeOnUpdateProcessingListener(EventListener<CloudletVmEventInfo> listener)
      Description copied from interface: Cloudlet
      Removes a listener from the onUpdateCloudletProcessingListener List.
      Specified by:
      removeOnUpdateProcessingListener in interface Cloudlet
      Parameters:
      listener - the listener to remove
      Returns:
      true if the listener was found and removed; false otherwise
    • addOnStartListener

      public Cloudlet addOnStartListener(EventListener<CloudletVmEventInfo> listener)
      Description copied from interface: Cloudlet
      Adds a Listener object that will be notified when the Cloudlet starts executing in some Vm.
      Specified by:
      addOnStartListener in interface Cloudlet
      Parameters:
      listener - the listener to add
    • removeOnStartListener

      public boolean removeOnStartListener(EventListener<CloudletVmEventInfo> listener)
      Description copied from interface: Cloudlet
      Removes a listener from the onStartListener List.
      Specified by:
      removeOnStartListener in interface Cloudlet
      Parameters:
      listener - the listener to remove
      Returns:
      true if the listener was found and removed; false otherwise
    • addOnFinishListener

      public Cloudlet addOnFinishListener(EventListener<CloudletVmEventInfo> listener)
      Description copied from interface: Cloudlet
      Adds a Listener object that will be notified when a cloudlet finishes its execution at a given Vm.
      Specified by:
      addOnFinishListener in interface Cloudlet
      Parameters:
      listener - the listener to add
      Returns:
    • removeOnFinishListener

      public boolean removeOnFinishListener(EventListener<CloudletVmEventInfo> listener)
      Description copied from interface: Cloudlet
      Removes a listener from the onCloudletFinishEventListener List
      Specified by:
      removeOnFinishListener in interface Cloudlet
      Parameters:
      listener - the listener to remove
      Returns:
      true if the listener was found and removed; false otherwise
      See Also:
    • notifyOnUpdateProcessingListeners

      public void notifyOnUpdateProcessingListeners(double time)
      Description copied from interface: Cloudlet
      Notifies all registered listeners about the update on Cloudlet processing.

      This method is used just internally and must not be called directly.

      Specified by:
      notifyOnUpdateProcessingListeners in interface Cloudlet
      Parameters:
      time - the time the event happened
    • setLength

      public final Cloudlet setLength(long length)
      Description copied from interface: Cloudlet
      Sets the execution length of this Cloudlet (in Million Instructions (MI)) that will be executed in each defined PE.

      In case the length is a negative value, it means the Cloudlet doesn't have a defined length, this way, it keeps running until a CloudSimTag.CLOUDLET_FINISH message is sent to the DatacenterBroker.

      According to this length and the power of the VM processor (in Million Instruction Per Second - MIPS) where the cloudlet will be run, the cloudlet will take a given time to finish processing. For instance, for a cloudlet of 10000 MI running on a processor of 2000 MIPS, the cloudlet will spend 5 seconds using the processor in order to be completed (that may be uninterrupted or not, depending on the scheduling policy).

      Specified by:
      setLength in interface Cloudlet
      Parameters:
      length - the length (in MI) of this Cloudlet to be executed in a Vm
      Returns:
      See Also:
    • setNetServiceLevel

      public void setNetServiceLevel(int netServiceLevel)
      Description copied from interface: Cloudlet
      Sets the Type of Service (ToS) for sending this cloudlet over a network.
      Specified by:
      setNetServiceLevel in interface Cloudlet
      Parameters:
      netServiceLevel - the new type of service (ToS) of this cloudlet
    • getNetServiceLevel

      public int getNetServiceLevel()
      Description copied from interface: Cloudlet
      Gets the Type of Service (ToS) of IPv4 for sending Cloudlet over the network. It is the ToS this cloudlet receives in the network (applicable to selected CloudletTaskScheduler class only).
      Specified by:
      getNetServiceLevel in interface Cloudlet
      Returns:
      the network service level
    • getWaitingTime

      public double getWaitingTime()
      Description copied from interface: Cloudlet
      Gets the time (in seconds) the cloudlet had to wait before start executing on a resource.
      Specified by:
      getWaitingTime in interface Cloudlet
      Returns:
      the waiting time (in seconds) when the cloudlet waited to execute; or 0 if there wasn't any waiting time or the cloudlet hasn't started to execute.
    • getPriority

      public int getPriority()
      Description copied from interface: Cloudlet
      Gets the priority of this Cloudlet for scheduling inside a Vm. Each CloudletScheduler implementation can define if it will use this attribute to impose execution priorities or not. How the priority is interpreted and what is the range of values it accepts depends on the CloudletScheduler that is being used by the Vm running the Cloudlet.
      Specified by:
      getPriority in interface Cloudlet
      Returns:
      priority of this cloudlet
    • setPriority

      public Cloudlet setPriority(int priority)
      Description copied from interface: Cloudlet
      Sets the priority of this Cloudlet for scheduling inside a Vm. Each CloudletScheduler implementation can define if it will use this attribute to impose execution priorities or not.

      WARNING: How the priority is interpreted and what is the range of values it accepts depends on the CloudletScheduler that is being used by the Vm running the Cloudlet.

      Specified by:
      setPriority in interface Cloudlet
      Parameters:
      priority - the priority to set
      Returns:
    • setNumberOfPes

      public final Cloudlet setNumberOfPes(long numberOfPes)
      Description copied from interface: Cloudlet
      Sets the number of PEs required to run this Cloudlet.
      NOTE: The Cloudlet length is computed only for 1 PE for simplicity.
      For example, consider a Cloudlet that has a length of 500 MI and requires 2 PEs. This means each PE will execute 500 MI of this Cloudlet.
      Specified by:
      setNumberOfPes in interface Cloudlet
      Parameters:
      numberOfPes - number of PEs
      Returns:
    • getNumberOfPes

      public long getNumberOfPes()
      Description copied from interface: Cloudlet
      Gets the number of Processing Elements (PEs) from the VM, that is required to execute this cloudlet.
      Specified by:
      getNumberOfPes in interface Cloudlet
      Returns:
      number of PEs
      See Also:
    • getFinishedLengthSoFar

      public long getFinishedLengthSoFar(Datacenter datacenter)
      Description copied from interface: Cloudlet
      Gets the length of this Cloudlet that has been executed so far (in MI), according to the Cloudlet.getLength(). This method is useful when trying to move this Cloudlet into different Datacenters or to cancel it.
      Specified by:
      getFinishedLengthSoFar in interface Cloudlet
      Parameters:
      datacenter - the Datacenter entity
      Returns:
      the length of a partially executed Cloudlet; the full Cloudlet length if it is completed; or 0 if the Cloudlet has never been executed in the given Datacenter
    • getFinishedLengthSoFar

      public long getFinishedLengthSoFar()
      Description copied from interface: Cloudlet
      Gets the length of this Cloudlet that has been executed so far from the latest Datacenter (in MI). This method is useful when trying to move this Cloudlet into different Datacenter or to cancel it.
      Specified by:
      getFinishedLengthSoFar in interface Cloudlet
      Returns:
      the length of a partially executed Cloudlet, or the full Cloudlet length if it is completed (in MI)
    • isFinished

      public boolean isFinished()
      Description copied from interface: Cloudlet
      Checks whether this Cloudlet has finished executing or not.
      Specified by:
      isFinished in interface Cloudlet
      Returns:
      true if this Cloudlet has finished execution; false otherwise
    • addFinishedLengthSoFar

      public boolean addFinishedLengthSoFar(long partialFinishedMI)
      Description copied from interface: Cloudlet
      Adds the partial length of this Cloudlet that has executed so far (in MI).
      Specified by:
      addFinishedLengthSoFar in interface Cloudlet
      Parameters:
      partialFinishedMI - the partial executed length of this Cloudlet (in MI) from the last time span (the last time the Cloudlet execution was updated)
      Returns:
      true if the length is valid and the cloudlet already has assigned to a Datacenter; false otherwise
      See Also:
    • getFileSize

      public long getFileSize()
      Description copied from interface: Cloudlet
      Gets the input file size of this Cloudlet before execution (in bytes). This size has to be considered the program + input data sizes.
      Specified by:
      getFileSize in interface Cloudlet
      Returns:
      the input file size of this Cloudlet (in bytes)
    • getOutputSize

      public long getOutputSize()
      Description copied from interface: Cloudlet
      Gets the output file size of this Cloudlet after execution (in bytes). It is the data produced as result of cloudlet execution that needs to be transferred thought the network to simulate sending response data to the user.
      Specified by:
      getOutputSize in interface Cloudlet
      Returns:
      the Cloudlet output file size (in bytes)
    • getExecStartTime

      public double getExecStartTime()
      Description copied from interface: Cloudlet
      Gets the latest execution start time of this Cloudlet (in seconds). This attribute only stores the latest execution time. Previous execution time are ignored. This time represents the simulation second when the cloudlet started.
      Specified by:
      getExecStartTime in interface Cloudlet
      Returns:
      the latest execution start time (in seconds)
    • setExecStartTime

      public void setExecStartTime(double clockTime)
      Description copied from interface: Cloudlet
      Sets the latest execution start time of this Cloudlet.

      NOTE: The execution start time only holds the latest one. Meaning all previous execution start times are ignored.

      Specified by:
      setExecStartTime in interface Cloudlet
      Parameters:
      clockTime - the latest execution start time
    • setWallClockTime

      public boolean setWallClockTime(double wallTime, double actualCpuTime)
      Description copied from interface: Cloudlet
      Sets the wall clock time the cloudlet spent executing on the current Datacenter. The wall clock time is the total time the Cloudlet resides in a Datacenter (from arrival time until departure time, that may include waiting time). This value is set by the Datacenter before departure or sending back to the original Cloudlet's owner.
      Specified by:
      setWallClockTime in interface Cloudlet
      Parameters:
      wallTime - the time of this Cloudlet resides in a Datacenter (from arrival time until departure time).
      actualCpuTime - the total execution time of this Cloudlet in a Datacenter.
      Returns:
      true if the submission time is valid and the cloudlet has already being assigned to a Datacenter for execution; false otherwise
    • setStatus

      public boolean setStatus(Cloudlet.Status newStatus)
      Description copied from interface: Cloudlet
      Sets the status of this Cloudlet.

      WARNING: This method is just used internally by classes such as CloudletScheduler to update Cloudlet status. Calling it directly might not get the expected result. You have to use the CloudletScheduler that controls the execution of the Cloudlet to change the Cloudlets status. The method is public due to a design issue.

      Specified by:
      setStatus in interface Cloudlet
      Parameters:
      newStatus - the status of this Cloudlet
      Returns:
      true if the cloudlet status was changed, i.e, if the newStatus is different from the current status; false otherwise
    • getLength

      public long getLength()
      Description copied from interface: Cloudlet
      Gets the execution length of this Cloudlet (in Million Instructions (MI)) that will be executed in each defined PE.

      In case the length is a negative value, it means the Cloudlet doesn't have a defined length, this way, it keeps running until a CloudSimTag.CLOUDLET_FINISH message is sent to the DatacenterBroker.

      According to this length and the power of the VM processor (in Million Instruction Per Second - MIPS) where the cloudlet will be run, the cloudlet will take a given time to finish processing. For instance, for a cloudlet of 10000 MI running on a processor of 2000 MIPS, the cloudlet will spend 5 seconds using the processor in order to be completed (that may be uninterrupted or not, depending on the scheduling policy).

      Specified by:
      getLength in interface Cloudlet
      Returns:
      the length of this Cloudlet (in MI)
      See Also:
    • absLength

      protected long absLength()
      Gets the absolute value of the length (without the signal). Check out getLength() for details.
      Returns:
    • getTotalLength

      public long getTotalLength()
      Description copied from interface: Cloudlet
      Gets the total length (across all PEs) of this Cloudlet (in MI). It considers the Cloudlet.getLength() of the cloudlet will be executed in each Pe defined by Cloudlet.getNumberOfPes().

      For example, setting the cloudletLength as 10000 MI and Cloudlet.getNumberOfPes() to 4, each Pe will execute 10000 MI. Thus, the entire Cloudlet has a total length of 40000 MI.

      Specified by:
      getTotalLength in interface Cloudlet
      Returns:
      the total length of this Cloudlet (in MI)
      See Also:
    • getCostPerSec

      public double getCostPerSec()
      Description copied from interface: Cloudlet
      Gets the cost/sec ($) of running the Cloudlet in the latest Datacenter.

      Realize costs must be defined for Datacenters by accessing the DatacenterCharacteristics object from each Datacenter instance and setting the CPU cost.

      Specified by:
      getCostPerSec in interface Cloudlet
      Returns:
      the cost ($) associated with running this Cloudlet; or 0.0 if was not assigned to any Datacenter yet
      See Also:
    • getCostPerSec

      public double getCostPerSec(Datacenter datacenter)
      Description copied from interface: Cloudlet
      Gets the cost ($) running this Cloudlet in a given Datacenter.

      Realize costs must be defined for Datacenters by accessing the DatacenterCharacteristics object from each Datacenter instance and setting the CPU cost.

      Specified by:
      getCostPerSec in interface Cloudlet
      Parameters:
      datacenter - the Datacenter entity
      Returns:
      the cost ($) associated with running this Cloudlet in the given Datacenter; or 0 if the Cloudlet was not executed there not found
      See Also:
    • getActualCpuTime

      protected double getActualCpuTime(Datacenter datacenter)
      Gets the total execution time of this Cloudlet in a given Datacenter ID.
      Parameters:
      datacenter - the Datacenter entity
      Returns:
      the total execution time of this Cloudlet in the given Datacenter or 0 if the Cloudlet was not executed there
    • getActualCpuTime

      public double getActualCpuTime()
      Description copied from interface: Cloudlet
      Returns the total execution time of the Cloudlet in seconds.
      Specified by:
      getActualCpuTime in interface Cloudlet
      Returns:
      time in which the Cloudlet was running; or Cloudlet.NOT_ASSIGNED if it hasn't finished yet
    • getArrivalTime

      public double getArrivalTime(Datacenter datacenter)
      Description copied from interface: Cloudlet
      Gets the arrival time of this Cloudlet in the given Datacenter (in seconds).
      Specified by:
      getArrivalTime in interface Cloudlet
      Parameters:
      datacenter - the Datacenter entity
      Returns:
      the arrival time (in seconds); or Cloudlet.NOT_ASSIGNED if the cloudlet has never been assigned to a Datacenter
    • getWallClockTime

      protected double getWallClockTime(Datacenter datacenter)
      Gets the time of this Cloudlet resides in a given Datacenter (from arrival time until departure time).
      Parameters:
      datacenter - a Datacenter entity
      Returns:
      the wall-clock time or 0 if the Cloudlet has never been executed there
      See Also:
    • getFinishTime

      public double getFinishTime()
      Description copied from interface: Cloudlet
      Gets the time when this Cloudlet has completed executing in the latest Datacenter. This time represents the simulation second when the cloudlet finished.
      Specified by:
      getFinishTime in interface Cloudlet
      Returns:
      the finish or completion time of this Cloudlet (in seconds); or Cloudlet.NOT_ASSIGNED if not finished yet.
    • setFinishTime

      protected final void setFinishTime(double finishTime)
      Sets the finish time of this cloudlet in the latest Datacenter.
      Parameters:
      finishTime - the finish time
    • getStatus

      public Cloudlet.Status getStatus()
      Description copied from interface: Cloudlet
      Gets the execution status of this Cloudlet.
      Specified by:
      getStatus in interface Cloudlet
      Returns:
      the Cloudlet status
    • isReturnedToBroker

      public boolean isReturnedToBroker()
      Description copied from interface: Cloudlet
      Checks if the Cloudlet has finished and returned to the broker, so that the broker is aware about the end of execution of the Cloudlet.
      Specified by:
      isReturnedToBroker in interface Cloudlet
      Returns:
    • getJobId

      public long getJobId()
      Description copied from interface: Cloudlet
      Gets the id of the job that this Cloudlet belongs to, if any. This field is just used for classification. If there is an supposed job that multiple Cloudlets belong to, one can set the job id for all Cloudlets of that job in order to classify them. Besides classification, this field doesn't have any effect.
      Specified by:
      getJobId in interface Cloudlet
      Returns:
      the job id; or Cloudlet.NOT_ASSIGNED if the Cloudlet doesn't belong to a job
    • setJobId

      public final void setJobId(long jobId)
      Description copied from interface: Cloudlet
      Sets the id of the job that this Cloudlet belongs to, if any. This field is just used for classification. If there is an supposed job that multiple Cloudlets belong to, one can set the job id for all Cloudlets of that job in order to classify them. Besides classification, this field doesn't have any effect.
      Specified by:
      setJobId in interface Cloudlet
      Parameters:
      jobId - the job id to set
    • getVm

      public Vm getVm()
      Description copied from interface: Cloudlet
      Gets the Vm that is planned to execute the cloudlet.
      Specified by:
      getVm in interface Cloudlet
      Returns:
      the VM; or Vm.NULL if the Cloudlet was not assigned to a VM yet
    • setVm

      public Cloudlet setVm(Vm vm)
      Description copied from interface: Cloudlet
      Sets the id of Vm that is planned to execute the cloudlet.
      Specified by:
      setVm in interface Cloudlet
      Parameters:
      vm - the id of vm to run the cloudlet
    • getTotalCost

      public double getTotalCost()
      Description copied from interface: Cloudlet
      Gets the total cost ($) of executing this Cloudlet.

      Total Cost = input data transfer + processing cost + output transfer cost.

      Realize costs must be defined for Datacenters by accessing the DatacenterCharacteristics object from each Datacenter instance and setting costs for each resource.

      Specified by:
      getTotalCost in interface Cloudlet
      Returns:
      the total cost ($) of executing the Cloudlet
      See Also:
    • getRequiredFiles

      public List<String> getRequiredFiles()
      Description copied from interface: Cloudlet
      Gets the list of required files to be used by the cloudlet (if any). The time to transfer these files by the network is considered when placing the cloudlet inside a given VM
      Specified by:
      getRequiredFiles in interface Cloudlet
      Returns:
      the required files
    • setRequiredFiles

      public final void setRequiredFiles(List<String> requiredFiles)
      Sets the list of required files.
      Parameters:
      requiredFiles - the new list of required files
    • addRequiredFile

      public boolean addRequiredFile(String fileName)
      Description copied from interface: Cloudlet
      Adds a file to the list or required files.
      Specified by:
      addRequiredFile in interface Cloudlet
      Parameters:
      fileName - the name of the required file
      Returns:
      true if the file was added (it didn't exist in the list of required files), false otherwise (it did already exist)
    • addRequiredFiles

      public boolean addRequiredFiles(List<String> fileNames)
      Description copied from interface: Cloudlet
      Adds a list of files to the required files list. Just the files that don't exist yet in the current required list will be added.
      Specified by:
      addRequiredFiles in interface Cloudlet
      Parameters:
      fileNames - the list of files to be added
      Returns:
      true if at least one file was added, false if no file was added (in the case that all given files already exist in the current required list)
    • deleteRequiredFile

      public boolean deleteRequiredFile(String filename)
      Description copied from interface: Cloudlet
      Deletes the given filename from the list.
      Specified by:
      deleteRequiredFile in interface Cloudlet
      Parameters:
      filename - the given filename to be deleted
      Returns:
      true if the file was found and removed, false if not found
    • hasRequiresFiles

      public boolean hasRequiresFiles()
      Description copied from interface: Cloudlet
      Checks whether this cloudlet requires any files or not.
      Specified by:
      hasRequiresFiles in interface Cloudlet
      Returns:
      true if required, false otherwise
    • getUtilizationModelCpu

      public UtilizationModel getUtilizationModelCpu()
      Description copied from interface: Cloudlet
      Gets the utilization model that defines how the cloudlet will use the VM's CPU.
      Specified by:
      getUtilizationModelCpu in interface Cloudlet
      Returns:
    • setUtilizationModelCpu

      public final Cloudlet setUtilizationModelCpu(UtilizationModel utilizationModelCpu)
      Description copied from interface: Cloudlet
      Specified by:
      setUtilizationModelCpu in interface Cloudlet
      Parameters:
      utilizationModelCpu - the new utilization model of cpu
    • getUtilizationModelRam

      public UtilizationModel getUtilizationModelRam()
      Description copied from interface: Cloudlet
      Gets the utilization model that defines how the cloudlet will use the VM's RAM.
      Specified by:
      getUtilizationModelRam in interface Cloudlet
      Returns:
    • setUtilizationModelRam

      public final Cloudlet setUtilizationModelRam(UtilizationModel utilizationModelRam)
      Description copied from interface: Cloudlet
      Specified by:
      setUtilizationModelRam in interface Cloudlet
      Parameters:
      utilizationModelRam - the new utilization model of ram
    • getUtilizationModelBw

      public UtilizationModel getUtilizationModelBw()
      Description copied from interface: Cloudlet
      Gets the utilization model that defines how the cloudlet will use the VM's bandwidth (bw).
      Specified by:
      getUtilizationModelBw in interface Cloudlet
      Returns:
    • setUtilizationModelBw

      public final Cloudlet setUtilizationModelBw(UtilizationModel utilizationModelBw)
      Description copied from interface: Cloudlet
      Specified by:
      setUtilizationModelBw in interface Cloudlet
      Parameters:
      utilizationModelBw - the new utilization model of bw
    • getUtilizationModel

      public UtilizationModel getUtilizationModel(Class<? extends ResourceManageable> resourceClass)
      Description copied from interface: Cloudlet
      Gets the utilization model for a given resource
      Specified by:
      getUtilizationModel in interface Cloudlet
      Parameters:
      resourceClass - the kind of resource to get its UtilizationModel
      Returns:
    • getUtilizationOfCpu

      public double getUtilizationOfCpu()
      Description copied from interface: Cloudlet
      Gets the utilization of CPU at the current simulation time, that is defined in percentage (from [0 to 1]) or absolute values, depending on the UtilizationModel.getUnit() set for the CPU utilizaton model.
      Specified by:
      getUtilizationOfCpu in interface Cloudlet
      Returns:
      the utilization % (from [0 to 1])
      See Also:
    • getUtilizationOfCpu

      public double getUtilizationOfCpu(double time)
      Description copied from interface: Cloudlet
      Gets the utilization of CPU at a given time, that is defined in percentage (from [0 to 1]) or absolute values, depending on the UtilizationModel.getUnit() defined for the Cloudlet.getUtilizationModelCpu().
      Specified by:
      getUtilizationOfCpu in interface Cloudlet
      Parameters:
      time - the time to get the utilization
      Returns:
      the utilization % (from [0 to 1])
      See Also:
    • getUtilizationOfBw

      public double getUtilizationOfBw()
      Description copied from interface: Cloudlet
      Gets the utilization of Bandwidth at the current simulation time, that is defined in percentage (from [0 to 1]) or absolute values, depending on the UtilizationModel.getUnit() set for the BW utilizaton model.
      Specified by:
      getUtilizationOfBw in interface Cloudlet
      Returns:
      the utilization % (from [0 to 1])
      See Also:
    • getUtilizationOfBw

      public double getUtilizationOfBw(double time)
      Description copied from interface: Cloudlet
      Gets the utilization of Bandwidth at a given time, that is defined in percentage (from [0 to 1]) or absolute values, depending on the UtilizationModel.getUnit() defined for the Cloudlet.getUtilizationModelBw().
      Specified by:
      getUtilizationOfBw in interface Cloudlet
      Parameters:
      time - the time to get the utilization
      Returns:
      the utilization % (from [0 to 1])
      See Also:
    • getUtilizationOfRam

      public double getUtilizationOfRam()
      Description copied from interface: Cloudlet
      Gets the utilization of RAM at the current simulation time, that is defined in percentage (from [0 to 1]) or absolute values, depending on the UtilizationModel.getUnit() set for the RAM utilizaton model.
      Specified by:
      getUtilizationOfRam in interface Cloudlet
      Returns:
      the utilization % (from [0 to 1])
      See Also:
    • getUtilizationOfRam

      public double getUtilizationOfRam(double time)
      Description copied from interface: Cloudlet
      Gets the utilization of RAM at a given time, that is defined in percentage (from [0 to 1]) or absolute values, depending on the UtilizationModel.getUnit() defined for the Cloudlet.getUtilizationModelRam().
      Specified by:
      getUtilizationOfRam in interface Cloudlet
      Parameters:
      time - the time to get the utilization
      Returns:
      the utilization % (from [0 to 1])
      See Also:
    • getCostPerBw

      public double getCostPerBw()
      Description copied from interface: Cloudlet
      Gets the cost ($) of each byte of bandwidth (bw) consumed.

      Realize costs must be defined for Datacenters by accessing the DatacenterCharacteristics object from each Datacenter instance and setting the bandwidth cost.

      Specified by:
      getCostPerBw in interface Cloudlet
      Returns:
      the cost ($) per bw
      See Also:
    • setCostPerBw

      protected final void setCostPerBw(double costPerBw)
      Parameters:
      costPerBw - the new cost per bw to set
    • getAccumulatedBwCost

      public double getAccumulatedBwCost()
      Description copied from interface: Cloudlet
      The total bandwidth (bw) cost ($) for transferring the cloudlet by the network, according to the Cloudlet.getFileSize().
      Specified by:
      getAccumulatedBwCost in interface Cloudlet
      Returns:
      the accumulated bw cost ($)
    • setAccumulatedBwCost

      protected final void setAccumulatedBwCost(double accumulatedBwCost)
      Parameters:
      accumulatedBwCost - the accumulated bw cost ($) to set
    • getSubmissionDelay

      public double getSubmissionDelay()
      Description copied from interface: Cloudlet
      Gets the time (in seconds) that a DatacenterBroker will wait to submit the entity to a Datacenter, in order to request the creation of the object. This is a relative time from the current simulation time.

      If the VM where the Cloudlet will run is submitted with some delay, the DatacenterBroker waits the VM creation. Only after the VM is created, the Cloudlet creation is requested with the delay specified here.

      Specified by:
      getSubmissionDelay in interface Cloudlet
      Specified by:
      getSubmissionDelay in interface Delayable
      Returns:
      the submission delay (in seconds)
    • setSubmissionDelay

      public final void setSubmissionDelay(double submissionDelay)
      Description copied from interface: Delayable
      Sets a relative time (in seconds), from current simulation time, that a DatacenterBroker will wait to submit the entity to a Datacenter, in order to request the creation of the object. This is a relative time from the current simulation time.
      Specified by:
      setSubmissionDelay in interface Delayable
      Parameters:
      submissionDelay - the amount of seconds from the current simulation time that the object will wait to be submitted
    • isDelayed

      public boolean isDelayed()
      Description copied from interface: Delayable
      Checks if this object has a submission delay or not
      Specified by:
      isDelayed in interface Delayable
      Returns:
    • isBoundToVm

      public boolean isBoundToVm()
      Description copied from interface: Cloudlet
      Indicates if the Cloudlet is bounded to a specific Vm, meaning that the DatacenterBroker doesn't have to select a VM for it. In this case, the Cloudlet was already bounded to a specific VM and must run on it.
      Specified by:
      isBoundToVm in interface Cloudlet
      Returns:
      true if the Cloudlet is bounded to a specific VM, false otherwise
    • setFileSize

      public final Cloudlet setFileSize(long fileSize)
      Description copied from interface: Cloudlet
      Sets the input file size of this Cloudlet before execution (in bytes). This size has to be considered the program + input data sizes.
      Specified by:
      setFileSize in interface Cloudlet
      Parameters:
      fileSize - the size to set (in bytes)
      Returns:
      See Also:
    • setOutputSize

      public final Cloudlet setOutputSize(long outputSize)
      Description copied from interface: Cloudlet
      Sets the output file size of this Cloudlet after execution (in bytes). It is the data produced as result of cloudlet execution that needs to be transferred thought the network to simulate sending response data to the user.
      Specified by:
      setOutputSize in interface Cloudlet
      Parameters:
      outputSize - the output size to set (in bytes)
      Returns:
      See Also:
    • setSizes

      public Cloudlet setSizes(long size)
      Description copied from interface: Cloudlet
      Sets the input and output file sizes of this Cloudlet to the same value (in bytes).
      Specified by:
      setSizes in interface Cloudlet
      Parameters:
      size - the value to set (in bytes) for input and output size
      Returns:
      See Also:
    • assignToDatacenter

      public void assignToDatacenter(Datacenter datacenter)
      Description copied from interface: Cloudlet
      Sets the parameters of the Datacenter where the Cloudlet is going to be executed. From the second time this method is called, every call makes the cloudlet to be migrated to the indicated Datacenter.

      NOTE: This method should be called only by a Datacenter entity.

      Specified by:
      assignToDatacenter in interface Cloudlet
      Parameters:
      datacenter - the Datacenter where the cloudlet will be executed
    • registerArrivalInDatacenter

      public double registerArrivalInDatacenter()
      Description copied from interface: Cloudlet
      Register the arrival time of this Cloudlet into a Datacenter to the current simulation time and returns this time.
      Specified by:
      registerArrivalInDatacenter in interface Cloudlet
      Returns:
      the arrived time set; or Cloudlet.NOT_ASSIGNED if the cloudlet is not assigned to a Datacenter
    • getLastDatacenterArrivalTime

      public double getLastDatacenterArrivalTime()
      Description copied from interface: Cloudlet
      Gets the arrival time of this Cloudlet from the latest Datacenter where it has executed (in seconds).
      Specified by:
      getLastDatacenterArrivalTime in interface Cloudlet
      Returns:
      the arrival time (in seconds); or Cloudlet.NOT_ASSIGNED if the cloudlet has never been assigned to a Datacenter