public abstract class AbstractTask extends Object implements ITask
Modifier and Type | Field and Description |
---|---|
protected IEnergyConsumptionProfile |
consumptionProfile |
Constructor and Description |
---|
AbstractTask(long firstRelease,
long wcet,
long wcee,
long period,
long deadline,
int priority,
IEnergyConsumptionProfile p) |
Modifier and Type | Method and Description |
---|---|
void |
activate(long time)
Activates a job of this task with a release time of 'time' units
|
boolean |
checkDeadlineMissed(long time)
Checks if the task missed its deadline by checking its current job at a
certain instant of time
|
PriorityQueue<Job> |
getActiveJobs()
Returns the active jobs of the task
|
Job |
getCurrentJob()
Gets the current job of the task, i.e. the first job that has not been
completed
|
long |
getDeadline()
Gets the relative deadline of the task
|
long |
getEnergyConsumption(long time)
Gets the energy consumption of the task if executed during a certain
period of time
|
IEnergyConsumptionProfile |
getEnergyConsumptionProfile() |
long |
getEnergyConsumptionRate()
Gets the energy consumption rate of the task rate = wcee / wcet
|
long |
getFirstRelease()
Gets the first release time of the task
|
int |
getId()
Gets the identifier of the task
|
Job |
getLastExecutedJob()
Gets task's last executed job
|
long |
getNextAbsoluteDeadline(long time)
Gets the absolute deadline of the next job of the task
|
long |
getNextActivation(long time)
Gets the next activation time of the task
|
long |
getNextDeadline(long time,
boolean nextPeriod)
Gets the absolute deadline of the current job of the task according to
the value of the boolean 'nextPeriod'
|
long |
getPeriod()
Gets the relative period of the task
|
long |
getPreviousAbsoluteDeadline(long time)
Gets the absolute deadline of the previous job of the task
|
int |
getPriority()
Gets the priority of the task
|
long |
getRemainingCost()
Gets the remaining time cost of task's current job
|
abstract String |
getType()
Gets the type of the task (simple, subtask, graph, ...)
|
long |
getWcee()
Gets the worst-case execution energy consumption of the task
|
long |
getWcet()
Gets the worst-case execution time of the task
|
boolean |
isActivationTime(long time)
Checks if a new job of task can be activated at 'time' instant of time
|
boolean |
isActive()
Checks if the task has active jobs
|
boolean |
lastExecutedJobHasCompleted()
Checks if the active job is not the last executed one
|
protected void |
setEnergyConsumptionProfile(IEnergyConsumptionProfile p) |
void |
setFirstRelease(long firstRelease)
Sets the first release time of a task
|
void |
setId(int id)
Sets an identifier to the task
|
void |
setLastExecutedJob(Job lastExecutedJob)
Sets last executed job of the task
|
void |
setPriority(int priority)
Sets the priority of the task
|
protected IEnergyConsumptionProfile consumptionProfile
public AbstractTask(long firstRelease, long wcet, long wcee, long period, long deadline, int priority, IEnergyConsumptionProfile p)
public int getId()
ITask
public void setId(int id)
ITask
public long getFirstRelease()
ITask
getFirstRelease
in interface ITask
public void setFirstRelease(long firstRelease)
ITask
setFirstRelease
in interface ITask
firstRelease
- first release timepublic long getWcet()
ITask
public long getWcee()
ITask
public long getPeriod()
ITask
public long getDeadline()
ITask
getDeadline
in interface ITask
public int getPriority()
ITask
getPriority
in interface ITask
public void setPriority(int priority)
ITask
setPriority
in interface ITask
priority
- task's priority to be setpublic long getEnergyConsumptionRate()
ITask
getEnergyConsumptionRate
in interface ITask
public long getEnergyConsumption(long time)
ITask
getEnergyConsumption
in interface ITask
time
- number of time's unitspublic PriorityQueue<Job> getActiveJobs()
ITask
getActiveJobs
in interface ITask
public boolean isActive()
ITask
public void activate(long time)
ITask
public Job getCurrentJob()
ITask
getCurrentJob
in interface ITask
public boolean checkDeadlineMissed(long time)
ITask
checkDeadlineMissed
in interface ITask
time
- time instantpublic boolean lastExecutedJobHasCompleted()
ITask
lastExecutedJobHasCompleted
in interface ITask
public long getRemainingCost()
ITask
getRemainingCost
in interface ITask
public long getNextDeadline(long time, boolean nextPeriod)
ITask
getNextDeadline
in interface ITask
time
- current instant of timenextPeriod
- if true, next period of the task is calculated. If false,
current period is calculatedpublic long getNextActivation(long time)
ITask
getNextActivation
in interface ITask
time
- current timepublic boolean isActivationTime(long time)
ITask
isActivationTime
in interface ITask
time
- current timepublic long getNextAbsoluteDeadline(long time)
ITask
getNextAbsoluteDeadline
in interface ITask
time
- current instant of timepublic long getPreviousAbsoluteDeadline(long time)
ITask
getPreviousAbsoluteDeadline
in interface ITask
public Job getLastExecutedJob()
ITask
getLastExecutedJob
in interface ITask
public void setLastExecutedJob(Job lastExecutedJob)
ITask
setLastExecutedJob
in interface ITask
lastExecutedJob
- the last executed job to setpublic IEnergyConsumptionProfile getEnergyConsumptionProfile()
getEnergyConsumptionProfile
in interface ITask
protected void setEnergyConsumptionProfile(IEnergyConsumptionProfile p)
Copyright © 2012. All Rights Reserved.