NetworkCloudlet

public class NetworkCloudlet extends CloudletSimple

NetworkCloudlet class extends Cloudlet to support simulation of complex applications. Each NetworkCloudlet represents a task of the application. Each task consists of several tasks.

Please refer to following publication for more details:

Author:Saurabh Kumar Garg, Manoel Campos da Silva Filho

Constructors

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 cloudlet
  • length – the length or size (in MI) of this cloudlet to be executed in a VM (check out setLength(long))
  • pesNumber – the pes number

Methods

addTask

public NetworkCloudlet addTask(CloudletTask task)

Adds a task to the task list and links the task to the NetworkCloudlet.

Parameters:
  • task – Task to be added
Returns:

the NetworkCloudlet instance

getCurrentTask

public Optional<CloudletTask> getCurrentTask()

Gets an Optional containing the current task or an Optional.empty().

getLength

public long getLength()

{@inheritDoc}

The length of a NetworkCloudlet is the length sum of all its CloudletExecutionTask’s.

Returns:the length sum of all CloudletExecutionTask’s

getMemory

public long getMemory()

Gets the Cloudlet’s RAM memory.

getNumberOfTasks

public double getNumberOfTasks()

getTasks

public List<CloudletTask> getTasks()
Returns:a read-only list of cloudlet’s tasks.

isFinished

public boolean isFinished()

isTasksStarted

public boolean isTasksStarted()

Checks if the some Cloudlet Task has started yet.

Returns:true if some task has started, false otherwise

setMemory

public NetworkCloudlet setMemory(long memory)

Sets the Cloudlet’s RAM memory.

Parameters:
  • memory – amount of RAM to set

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