Class NetworkCloudlet
- All Implemented Interfaces:
Comparable<Cloudlet>,Cloudlet,ChangeableId,CustomerEntity,ExecDelayable,Identifiable,Lifetimed,Startable,SubmissionDelayable,UniquelyIdentifiable
CloudletTasks
for performing different kinds of processing.
Please refer to the 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.cloudsimplus.cloudlets.Cloudlet
Cloudlet.Status -
Field Summary
Fields inherited from interface org.cloudsimplus.core.Startable
NOT_ASSIGNED -
Constructor Summary
ConstructorsConstructorDescriptionNetworkCloudlet(int pesNumber) Creates a NetworkCloudlet with no priority, no file size and output size equal to 1.NetworkCloudlet(int id, int pesNumber) Creates a NetworkCloudlet with no priority, no file size and output size equal to 1. -
Method Summary
Modifier and TypeMethodDescriptionaddTask(@NonNull CloudletTask task) Adds a task to thetask listand links the task to this NetworkCloudlet.longGets the execution length of this Cloudlet (in Million Instructions (MI)) that will be executed in each definedPe.doublegetTasks()getVm()booleanbooleanChecks if some Cloudlet Task has started yet.Sets the id ofVmthat is planned to execute the cloudlet.booleanstartNextTaskIfCurrentIsFinished(double nextTaskStartTime) Change the current task to the next one to start executing it, if the current task is finished.Methods inherited from class org.cloudsimplus.cloudlets.CloudletSimple
compareTo, toStringMethods inherited from class org.cloudsimplus.cloudlets.CloudletAbstract
absLength, addFinishedLengthSoFar, addOnFinishListener, addOnStartListener, addOnUpdateProcessingListener, addRequiredFile, addRequiredFiles, deleteRequiredFile, getFinishedLengthSoFar, getStartWaitTime, getTotalLength, getUtilizationModel, getUtilizationOfBw, getUtilizationOfBw, getUtilizationOfCpu, getUtilizationOfCpu, getUtilizationOfRam, getUtilizationOfRam, hasRequiresFiles, isBoundToVm, isLifeTimeReached, isSubmissionDelayed, notifyOnUpdateProcessingListeners, onFinish, onStart, registerArrivalInDatacenter, removeOnFinishListener, removeOnStartListener, removeOnUpdateProcessingListener, reset, setDcArrivalTime, setFileSize, setLength, setNetServiceLevel, setOutputSize, setPesNumber, setRequiredFiles, setSizes, setStatus, setSubmissionDelay, setUtilizationModel, shutdownMethods inherited from class org.cloudsimplus.core.CustomerEntityAbstract
getCreationWaitTime, getSimulation, getUid, setCreationTime, setCreationTime, setLifeTimeMethods inherited from class org.cloudsimplus.core.ExecDelayableAbstract
isShuttingDown, setShutDownDelay, setStartupDelayMethods inherited from class org.cloudsimplus.core.StartableAbstract
getTotalExecutionTime, setFinishTime, setStartTimeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.cloudsimplus.core.ChangeableId
setIdMethods inherited from interface org.cloudsimplus.cloudlets.Cloudlet
getBroker, getDcArrivalTime, getFileSize, getFinishTime, getJobId, getLifeTime, getNetServiceLevel, getOutputSize, getPesNumber, getPriority, getRequiredFiles, getStartTime, getStatus, getSubmissionDelay, getUtilizationModelBw, getUtilizationModelCpu, getUtilizationModelRam, isReturnedToBroker, isRunning, setBroker, setJobId, setLifeTime, setPriority, setShutDownDelay, setStartTime, setStartupDelay, setUtilizationModelBw, setUtilizationModelCpu, setUtilizationModelRamMethods inherited from interface org.cloudsimplus.core.CustomerEntity
getBrokerArrivalTime, getCreationTime, getCreationWaitTime, getLastTriedDatacenter, setBrokerArrivalTime, setLastTriedDatacenterMethods inherited from interface org.cloudsimplus.core.ExecDelayable
getRemainingStartupTime, getShutdownBeginTime, getShutDownDelay, getStartupCompletionTime, getStartupDelay, isShutDownDelayed, isShuttingDown, isStartingUp, isStartupDelayed, setShutdownBeginTimeMethods inherited from interface org.cloudsimplus.core.Identifiable
getIdMethods inherited from interface org.cloudsimplus.core.Startable
getLastBusyTime, getSimulation, getTotalExecutionTime, hasStarted, setFinishTime, setLastBusyTimeMethods inherited from interface org.cloudsimplus.core.UniquelyIdentifiable
getUid
-
Constructor Details
-
NetworkCloudlet
-
NetworkCloudlet
public NetworkCloudlet(int id, int pesNumber) Creates a NetworkCloudlet with no priority, no file size and output size equal to 1. The length of the Cloudlet is determined by the sum of itstaskslength.- Parameters:
id- the unique ID of this cloudletpesNumber- the number ofPes this Cloudlet requires
-
-
Method Details
-
getNumberOfTasks
public double getNumberOfTasks() -
getTasks
- Returns:
- a read-only list of Cloudlet's tasks.
-
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 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 is finished and the next one has started; false if current task is not finished or there aren't any more tasks to be executed.
-
getCurrentTask
- Returns:
- an
Optionalcontaining the current task orOptional.empty()if there is no current task yet.
-
isFinished
public boolean isFinished()- Specified by:
isFinishedin interfaceStartable- Overrides:
isFinishedin classCloudletAbstract- Returns:
- true if this entity 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 definedPe.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_FINISHmessage 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 until 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.- Returns:
- the length sum of all
CloudletExecutionTask's - See Also:
-
addTask
Adds a task to thetask listand links the task to this NetworkCloudlet.- Parameters:
task- Task to be added- Returns:
- this NetworkCloudlet instance
-
getVm
-
setVm
-