public class GraphTask extends PeriodicTask implements ITaskElement
consumptionProfile
Constructor and Description |
---|
GraphTask(GraphTask graphTask) |
GraphTask(long firstrelease,
long wcee,
long period,
long deadline,
int priority,
ArrayList<SubTask> subtasks,
IEnergyConsumptionProfile p) |
Modifier and Type | Method and Description |
---|---|
void |
accept(ITaskElementVisitor visitor)
Accept function for the visitable element
|
void |
activate(long time)
Activates a job of this task with a release time of 'time' units
|
void |
addEdge(SubTask parent,
SubTask child)
Adds a directed edge between 2 subtasks in the graph
|
void |
addTask(SubTask subtask)
Adds a subtask to the graph
|
void |
calculateCriticalPath() |
boolean |
canAddEdge(SubTask subtask1,
SubTask subtask2)
Verify if an edge can be created between 2 subtasks in a graph an edge
can't be created if 2 subtasks share the same parent
|
ITask |
cloneTask()
Duplicates the task's object
|
SubTask |
getEndingSubtask()
Gets the ending subtask of a graph which is the subtask with no children
subtasks graph has one ending subtask
|
long |
getLaxity()
Laxity of a graph is the difference between its deadline and its latest
finish time after calculating the critical path
|
long |
getSlack()
Gets the slack time of the graph, which is equal to the latest or
earliest finish time of the ending task after calculating the critical
path of the graph.
|
SubTask |
getStartingSubtask()
Gets the starting subtask of a graph which is the subtask with no parent
subtasks graph has one starting subtask
|
ArrayList<SubTask> |
getSubtasks()
Gets the subtasks of the graph
|
String |
getType()
Gets the type of the task (simple, subtask, graph, ...)
|
void |
parallelizeGraph() |
void |
printCriticalInfo()
Prints the earliest and the latest execution time of a subtask to finish
in a graph
|
void |
removeEdge(SubTask parent,
SubTask child)
Removes a directed edge between 2 subtasks in the graph
|
void |
removeTask(SubTask subtask)
Removes a subtask from the graph and its edges
|
String |
toString() |
getDensity, getUtilization, isArbitraryDeadline, isConstrainedDeadline, isImplicitDeadline
checkDeadlineMissed, getActiveJobs, getCurrentJob, getDeadline, getEnergyConsumption, getEnergyConsumptionProfile, getEnergyConsumptionRate, getFirstRelease, getId, getLastExecutedJob, getNextAbsoluteDeadline, getNextActivation, getNextDeadline, getPeriod, getPreviousAbsoluteDeadline, getPriority, getRemainingCost, getWcee, getWcet, isActivationTime, isActive, lastExecutedJobHasCompleted, setEnergyConsumptionProfile, setFirstRelease, setId, setLastExecutedJob, setPriority
public GraphTask(long firstrelease, long wcee, long period, long deadline, int priority, ArrayList<SubTask> subtasks, IEnergyConsumptionProfile p)
public GraphTask(GraphTask graphTask)
public ArrayList<SubTask> getSubtasks()
public SubTask getStartingSubtask()
public SubTask getEndingSubtask()
public long getSlack()
public void removeTask(SubTask subtask)
subtask
- subtask to be removedpublic void addTask(SubTask subtask)
subtask
- subtask to be addedpublic void addEdge(SubTask parent, SubTask child)
parent
- parent subtaskchild
- child subtaskpublic void removeEdge(SubTask parent, SubTask child)
parent
- parent subtaskchild
- child subtaskpublic boolean canAddEdge(SubTask subtask1, SubTask subtask2)
subtask1
- first subtasksubtask2
- second subtaskpublic void calculateCriticalPath()
public void parallelizeGraph()
public void printCriticalInfo()
public ITask cloneTask()
ITask
public void accept(ITaskElementVisitor visitor)
accept
in interface ITaskElement
public String getType()
ITask
getType
in interface ITask
getType
in class AbstractTask
public long getLaxity()
public void activate(long time)
ITask
activate
in interface ITask
activate
in class AbstractTask
time
- time unitsCopyright © 2012. All Rights Reserved.