Class NetworkCloudlet
- All Implemented Interfaces:
Comparable<Cloudlet>
,Cloudlet
,ChangeableId
,CustomerEntity
,Delayable
,Identifiable
,UniquelyIdentifiable
CloudletTask
s
for performing different kinds of processing.
Please refer to following publication for more details:
- Since:
- CloudSim Toolkit 1.0 TODO Check how to implement the NULL pattern for this class.
- Author:
- Saurabh Kumar Garg, Manoel Campos da Silva Filho
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.cloudbus.cloudsim.cloudlets.Cloudlet
Cloudlet.Status
-
Field Summary
Fields inherited from interface org.cloudbus.cloudsim.cloudlets.Cloudlet
NOT_ASSIGNED, NULL
-
Constructor Summary
ConstructorDescriptionNetworkCloudlet
(int id, long length, int pesNumber) Creates a NetworkCloudlet with no priority and file size and output size equal to 1.NetworkCloudlet
(long length, int pesNumber) Creates a NetworkCloudlet with no priority and file size and output size equal to 1. -
Method Summary
Modifier and TypeMethodDescriptionaddTask
(CloudletTask task) Adds a task to thetask list
and links the task to the NetworkCloudlet.Gets anOptional
containing the current task or anOptional.empty()
if there is no current task yet.long
Gets the execution length of this Cloudlet (in Million Instructions (MI)) that will be executed in each defined PE.long
Gets the Cloudlet's RAM memory (in Megabytes).double
getTasks()
getVm()
Gets the Vm that is planned to execute the cloudlet.boolean
Checks whether this Cloudlet has finished executing or not.boolean
Checks if some Cloudlet Task has started yet.setMemory
(long memory) Sets the Cloudlet's RAM memory.Sets the id ofVm
that is planned to execute the cloudlet.boolean
startNextTaskIfCurrentIsFinished
(double nextTaskStartTime) Change the current task to the next one in order to start executing it, if the current task is finished.Methods inherited from class org.cloudbus.cloudsim.cloudlets.CloudletSimple
compareTo, toString
Methods inherited from class org.cloudbus.cloudsim.cloudlets.CloudletAbstract
absLength, addFinishedLengthSoFar, addOnFinishListener, addOnStartListener, addOnUpdateProcessingListener, addRequiredFile, addRequiredFiles, assignToDatacenter, deleteRequiredFile, getAccumulatedBwCost, getActualCpuTime, getActualCpuTime, getArrivalTime, getCostPerBw, getCostPerSec, getCostPerSec, getExecStartTime, getFileSize, getFinishedLengthSoFar, getFinishedLengthSoFar, getFinishTime, getJobId, getLastDatacenterArrivalTime, getLastExecutedDatacenterIdx, getNetServiceLevel, getNumberOfPes, getOutputSize, getPriority, getRequiredFiles, getStatus, getSubmissionDelay, getTotalCost, getTotalLength, getUtilizationModel, getUtilizationModelBw, getUtilizationModelCpu, getUtilizationModelRam, getUtilizationOfBw, getUtilizationOfBw, getUtilizationOfCpu, getUtilizationOfCpu, getUtilizationOfRam, getUtilizationOfRam, getWaitingTime, getWallClockTime, hasRequiresFiles, isBoundToVm, isDelayed, isReturnedToBroker, notifyOnUpdateProcessingListeners, registerArrivalInDatacenter, removeOnFinishListener, removeOnStartListener, removeOnUpdateProcessingListener, reset, setAccumulatedBwCost, setCostPerBw, setExecStartTime, setFileSize, setFinishTime, setJobId, setLastExecutedDatacenterIdx, setLength, setNetServiceLevel, setNumberOfPes, setOutputSize, setPriority, setRequiredFiles, setSizes, setStatus, setSubmissionDelay, setUtilizationModel, setUtilizationModelBw, setUtilizationModelCpu, setUtilizationModelRam, setWallClockTime
Methods inherited from class org.cloudbus.cloudsim.core.CustomerEntityAbstract
equals, getArrivedTime, getBroker, getCreationTime, getId, getLastTriedDatacenter, getSimulation, getUid, getWaitTime, hashCode, setArrivedTime, setBroker, setCreationTime, setCreationTime, setId, setLastTriedDatacenter
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.cloudbus.cloudsim.core.ChangeableId
setId
Methods inherited from interface org.cloudbus.cloudsim.core.CustomerEntity
getArrivedTime, getCreationTime, getLastTriedDatacenter, getSimulation, getWaitTime, setArrivedTime, setLastTriedDatacenter
Methods inherited from interface org.cloudbus.cloudsim.core.Identifiable
getId
Methods inherited from interface org.cloudbus.cloudsim.core.UniquelyIdentifiable
getUid
-
Constructor Details
-
NetworkCloudlet
public NetworkCloudlet(long length, int pesNumber) Creates a NetworkCloudlet with no priority and file size and output size equal to 1.- Parameters:
length
- the length or size (in MI) of this cloudlet to be executed in a VM (check outCloudletAbstract.setLength(long)
)pesNumber
- the number of PEs this Cloudlet requires
-
NetworkCloudlet
public NetworkCloudlet(int id, long length, int pesNumber) Creates a NetworkCloudlet with no priority and file size and output size equal to 1.- Parameters:
id
- the unique ID of this cloudletlength
- the length or size (in MI) of this cloudlet to be executed in a VM (check outCloudletAbstract.setLength(long)
)pesNumber
- the pes number
-
-
Method Details
-
getNumberOfTasks
public double getNumberOfTasks() -
getTasks
- Returns:
- a read-only list of Cloudlet's tasks.
-
getMemory
public long getMemory()Gets the Cloudlet's RAM memory (in Megabytes). TODO Required, allocated, used memory? It doesn't appear to be used. -
setMemory
Sets the Cloudlet's RAM memory.- Parameters:
memory
- amount of RAM to set (in Megabytes) TODO Cloudlet has theCloudletAbstract.getUtilizationModelRam()
that defines how RAM is used. This way, this attribute doesn't make sense since usage of RAM is dynamic. The attribute would be used to know what is the maximum memory the cloudlet can use, but that will be the maximum VM RAM capacity or a different value defined by a UtilizationModel.
-
isTasksStarted
public boolean isTasksStarted()Checks if some Cloudlet Task has started yet.- Returns:
- true if some task has started, false otherwise
-
startNextTaskIfCurrentIsFinished
public boolean startNextTaskIfCurrentIsFinished(double nextTaskStartTime) Change the current task to the next one in order to start executing it, if the current task is finished.- Parameters:
nextTaskStartTime
- the time that the next task will start- Returns:
- true if the current task finished and the next one was started, false otherwise
-
getCurrentTask
Gets anOptional
containing the current task or anOptional.empty()
if there is no current task yet.- Returns:
-
isFinished
public boolean isFinished()Description copied from interface:Cloudlet
Checks whether this Cloudlet has finished executing or not.- Specified by:
isFinished
in interfaceCloudlet
- Overrides:
isFinished
in classCloudletAbstract
- Returns:
- true if this Cloudlet has finished execution; false otherwise
-
getLength
public long getLength()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 theDatacenterBroker
.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).
The length of a NetworkCloudlet is the length sum of all its
CloudletExecutionTask
's.- Specified by:
getLength
in interfaceCloudlet
- Overrides:
getLength
in classCloudletAbstract
- Returns:
- the length sum of all
CloudletExecutionTask
's - See Also:
-
addTask
Adds a task to thetask list
and links the task to the NetworkCloudlet.- Parameters:
task
- Task to be added- Returns:
- the NetworkCloudlet instance
-
getVm
Description copied from interface:Cloudlet
Gets the Vm that is planned to execute the cloudlet.- Specified by:
getVm
in interfaceCloudlet
- Overrides:
getVm
in classCloudletAbstract
- Returns:
- the VM; or
Vm.NULL
if the Cloudlet was not assigned to a VM yet
-
setVm
Description copied from interface:Cloudlet
Sets the id ofVm
that is planned to execute the cloudlet.- Specified by:
setVm
in interfaceCloudlet
- Overrides:
setVm
in classCloudletAbstract
- Parameters:
vm
- the id of vm to run the cloudlet
-