Class Task

java.lang.Object
   |
   +----Task

public class Task
extends Object
implements EventDestination
Implements a task, which is part of a job. A unique number, called the global task identifier, is associated with each job. This identifier is composed of the identifier for the job that the task is part of, and a local task identifier which uniquely identifies a task within its job.

See Also:
JobManager, Job

Variable Index

 o COMMUNICATING
The communicating state.
 o ENDED
The ended state.
 o MIGRATING
The migrating state.
 o READY
The ready state.
 o RUNNING
The running state.
 o spinTime
Spin time of the task
 o SUSPENDED
The suspended state.
 o SYNCHRONIZING
The synchronizing state.

Method Index

 o getAverageCommunicationTime()
Returns the average communication time.
 o getAverageIOTime()
Returns the average I/O time.
 o getAverageSynchronizationTime()
Returns the average synchronization time.
 o getComputationTime()
Returns the computation time of this task.
 o getExecutionTime()
Returns the total execution time for this task.
 o getId()
Returns the global task identifier for this object.
 o getJob()
Returns object Job associated with this task.
 o getJobId()
 o getLocalId()
Returns the local task identifier for this object.
 o getMaxCommunicationTime()
Returns the maximum communication time.
 o getMaxIOTime()
Returns the maximum I/O time.
 o getMaxSynchronizationTime()
Returns the maximum synchronization time.
 o getNumberOfIOOperations()
Returns the number of I/O operations performed by this task.
 o getNumberOfReceives()
Returns the number of messages received by this task.
 o getNumberOfSends()
Returns the number of messages sent by this task.
 o getNumberOfSynchronizations()
Returns the number of synchronization performed by this task.
 o getPEId()
Returns the identifier for the processing element that this object belongs to.
 o getSpinning()
Returns true if a task is spinning.
 o getSpinSync()
Returns if a task is spinning due to synchronization.
 o getState()
Returns the current state of this object.
 o getTaskSpinning()
Returns if the task is spinning or not.
 o getTimeToFirstScheduling()
Returns the time from task creation to first scheduling of this task.
 o getTotalCommunicationTime()
Returns the total Communication time.
 o getTotalIOTime()
Returns the total I/O time.
 o getTotalSynchronizationTime()
Returns the total Synchronization time.
 o handleEvent(SimEvent)
Handles incoming events.
 o jobIdPart(long)
Returns the global job identifier part of the given global task identifier.
 o localIdPart(long)
Returns the local task identifier part of the given global task identifier.
 o makeId(int, int)
Creates a global task identifier from a global job identifier and a local task identifier.
 o toString()
Returns a string representation of this object.

Variables

 o READY
 public static final int READY
The ready state.

 o RUNNING
 public static final int RUNNING
The running state.

 o ENDED
 public static final int ENDED
The ended state.

 o SUSPENDED
 public static final int SUSPENDED
The suspended state.

 o SYNCHRONIZING
 public static final int SYNCHRONIZING
The synchronizing state.

 o MIGRATING
 public static final int MIGRATING
The migrating state.

 o COMMUNICATING
 public static final int COMMUNICATING
The communicating state.

 o spinTime
 public float spinTime
Spin time of the task

Methods

 o makeId
 public static long makeId(int jobId,
                           int localId)
Creates a global task identifier from a global job identifier and a local task identifier.

Parameters:
jobId - a global job identifier.
localId - a local task identifier.
Returns:
a global task identifier.
 o jobIdPart
 public static int jobIdPart(long taskId)
Returns the global job identifier part of the given global task identifier.

Parameters:
taskId - a global task identifier.
Returns:
a global job identifier.
 o localIdPart
 public static int localIdPart(long taskId)
Returns the local task identifier part of the given global task identifier.

Parameters:
taskId - a global task identifier.
Returns:
a local task identifier.
 o getId
 public long getId()
Returns the global task identifier for this object.

Returns:
the global task identifier for this object.
 o getLocalId
 public int getLocalId()
Returns the local task identifier for this object.

Returns:
the local task identifier for this object.
 o getState
 public int getState()
Returns the current state of this object.

Returns:
the current state of this object.
 o getSpinning
 public boolean getSpinning()
Returns true if a task is spinning.

Returns:
s true if a task is spinning.
 o getSpinSync
 public boolean getSpinSync()
Returns if a task is spinning due to synchronization.

Returns:
s if a task is spinning due to synchronization.
 o getJobId
 public int getJobId()
 o getJob
 public Job getJob()
Returns object Job associated with this task.

Returns:
s object Job associated with this task.
 o getPEId
 public int getPEId()
Returns the identifier for the processing element that this object belongs to.

Returns:
the identifier for the processing element that this object belongs to.
 o getComputationTime
 public float getComputationTime()
Returns the computation time of this task.

Returns:
the computation time of this task.
 o getNumberOfSends
 public int getNumberOfSends()
Returns the number of messages sent by this task.

Returns:
the number of messages sent by this task.
 o getNumberOfReceives
 public int getNumberOfReceives()
Returns the number of messages received by this task.

Returns:
the number of messages received by this task.
 o getAverageCommunicationTime
 public float getAverageCommunicationTime()
Returns the average communication time.

Returns:
the average communication time.
 o getMaxCommunicationTime
 public float getMaxCommunicationTime()
Returns the maximum communication time.

Returns:
the maximum communication time.
 o getNumberOfSynchronizations
 public int getNumberOfSynchronizations()
Returns the number of synchronization performed by this task.

Returns:
the number of synchronization performed by this task.
 o getTaskSpinning
 public boolean getTaskSpinning()
Returns if the task is spinning or not.

Returns:
if the task is spinning or not.
 o getAverageSynchronizationTime
 public float getAverageSynchronizationTime()
Returns the average synchronization time.

Returns:
the average synchronization time.
 o getMaxSynchronizationTime
 public float getMaxSynchronizationTime()
Returns the maximum synchronization time.

Returns:
the maximum synchronization time.
 o getNumberOfIOOperations
 public int getNumberOfIOOperations()
Returns the number of I/O operations performed by this task.

Returns:
the number of I/O operations performed by this task.
 o getAverageIOTime
 public float getAverageIOTime()
Returns the average I/O time.

Returns:
the average I/O time.
 o getMaxIOTime
 public float getMaxIOTime()
Returns the maximum I/O time.

Returns:
the maximum I/O time.
 o getTotalSynchronizationTime
 public float getTotalSynchronizationTime()
Returns the total Synchronization time.

Returns:
the total Synchronization time.
 o getTotalCommunicationTime
 public float getTotalCommunicationTime()
Returns the total Communication time.

Returns:
the total Communication time.
 o getTotalIOTime
 public float getTotalIOTime()
Returns the total I/O time.

Returns:
the total I/O time.
 o getTimeToFirstScheduling
 public float getTimeToFirstScheduling()
Returns the time from task creation to first scheduling of this task.

Returns:
the time from task creation to first scheduling of this task.
 o getExecutionTime
 public float getExecutionTime()
Returns the total execution time for this task.

Returns:
the total execution time for this task.
 o handleEvent
 public void handleEvent(SimEvent event)
Handles incoming events.

Parameters:
event - incoming event.
 o toString
 public String toString()
Returns a string representation of this object.

Returns:
a string representation of this object.
Overrides:
toString in class Object