Class Task
-
- All Implemented Interfaces:
-
java.io.Serializable,jline.lang.Copyable
public class Task extends LayeredNetworkElement
A Task represents a software component or process in a layered queueing network that can host services (Entry objects) and runs on a Processor (Host).
Tasks are fundamental building blocks in layered queueing networks that encapsulate:
- Service entries that define the interfaces accessible to other tasks
- Activities that represent internal processing steps
- Activity precedences that define the execution order and relationships
- Resource demands and scheduling policies
Key characteristics:
- Multiplicity: Number of concurrent task instances that can execute
- Scheduling: How the task schedules its internal processing (FCFS, PS, etc.)
- Think time: Time between completing one request and starting the next
- Reference tasks: Special tasks that generate workload (external customers)
Tasks can be reference tasks (SchedStrategy.REF) that represent external workload generators, or regular tasks that provide services to other tasks in the system.
-
-
Field Summary
Fields Modifier and Type Field Description protected Processorparentprotected intmultiplicityprotected intreplicationprotected SchedStrategyschedulingprotected intpriorityprotected StringfanInSourceprotected intfanInValueprotected DistributionthinkTimeprotected doublethinkTimeMeanprotected doublethinkTimeSCVprotected DistributionsetupTimeprotected doublesetupTimeMeanprotected doublesetupTimeSCVprotected DistributiondelayOffTimeprotected doubledelayOffTimeMeanprotected doubledelayOffTimeSCVprotected List<Entry>entriesprotected List<Activity>activitiesprotected List<ActivityPrecedence>precedencespublic final static intACTIVITYpublic final static intCALLpublic final static intENTRYpublic final static intHOSTpublic final static intPROCESSORpublic final static intTASKpublic LayeredNetworkmodelprotected Stringname
-
Constructor Summary
Constructors Constructor Description Task(LayeredNetwork model, String name, int multiplicity, SchedStrategy scheduling, Distribution thinkTime)Task(LayeredNetwork model, String name, int multiplicity, SchedStrategy scheduling)Task(LayeredNetwork model, String name, int multiplicity)Task(LayeredNetwork model, String name)
-
Method Summary
Modifier and Type Method Description TaskaddActivity(Activity newActivity)TaskaddEntry(Entry newEntry)TaskaddPrecedence(ActivityPrecedence newPrec)TaskaddPrecedence(List<ActivityPrecedence> newPrec)TaskaddPrecedence(Array<ActivityPrecedence> newPrec)doublegetMeanHostDemand(String entryName)Taskon(Processor parent)TaskremoveActivity(int index)TasksetActivity(Activity newActivity, int index)TasksetAsReferenceTask()TasksetReplication(int replication)TasksetThinkTime(Distribution thinkTime)TasksetThinkTime(double thinkTime)TasksetSetupTime(Distribution setupTime)Set the setup time (cold start time) for the task. TasksetSetupTime(double setupTime)Set the setup time using a mean value (creates exponential distribution). TasksetDelayOffTime(Distribution delayOffTime)Set the delay-off time (teardown time) for the task. TasksetDelayOffTime(double delayOffTime)Set the delay-off time using a mean value (creates exponential distribution). DistributiongetSetupTime()doublegetSetupTimeMean()doublegetSetupTimeSCV()DistributiongetDelayOffTime()doublegetDelayOffTimeMean()doublegetDelayOffTimeSCV()intgetMultiplicity()intgetReplication()SchedStrategygetScheduling()doublegetThinkTimeMean()doublegetThinkTimeSCV()HostgetParent()voidsetMultiplicity(int multiplicity)voidsetScheduling(SchedStrategy scheduling)List<ActivityPrecedence>getPrecedences()booleanhasSetupDelayoff()Check if this task has setup/delayoff configured (i.e., non-trivial values). List<Entry>getEntries()Returns the list of entries for this task. List<Activity>getActivities()Returns the list of activities for this task. ProcessorgetProcessor()Returns the processor (host) that this task runs on. TasksetPriority(int priority)intgetPriority()TasksetFanIn(String source, int value)StringgetFanInSource()intgetFanInValue()TasksetReplyEntry(List<Entry> replyEntry)-
-
Constructor Detail
-
Task
Task(LayeredNetwork model, String name, int multiplicity, SchedStrategy scheduling, Distribution thinkTime)
-
Task
Task(LayeredNetwork model, String name, int multiplicity, SchedStrategy scheduling)
-
Task
Task(LayeredNetwork model, String name, int multiplicity)
-
Task
Task(LayeredNetwork model, String name)
-
-
Method Detail
-
addActivity
Task addActivity(Activity newActivity)
-
addPrecedence
Task addPrecedence(ActivityPrecedence newPrec)
-
addPrecedence
Task addPrecedence(List<ActivityPrecedence> newPrec)
-
addPrecedence
Task addPrecedence(Array<ActivityPrecedence> newPrec)
-
getMeanHostDemand
double getMeanHostDemand(String entryName)
-
removeActivity
Task removeActivity(int index)
-
setActivity
Task setActivity(Activity newActivity, int index)
-
setAsReferenceTask
Task setAsReferenceTask()
-
setReplication
Task setReplication(int replication)
-
setThinkTime
Task setThinkTime(Distribution thinkTime)
-
setThinkTime
Task setThinkTime(double thinkTime)
-
setSetupTime
Task setSetupTime(Distribution setupTime)
Set the setup time (cold start time) for the task.
- Parameters:
setupTime- The setup time distribution- Returns:
This Task instance for method chaining
-
setSetupTime
Task setSetupTime(double setupTime)
Set the setup time using a mean value (creates exponential distribution).
- Parameters:
setupTime- The mean setup time- Returns:
This Task instance for method chaining
-
setDelayOffTime
Task setDelayOffTime(Distribution delayOffTime)
Set the delay-off time (teardown time) for the task.
- Parameters:
delayOffTime- The delay-off time distribution- Returns:
This Task instance for method chaining
-
setDelayOffTime
Task setDelayOffTime(double delayOffTime)
Set the delay-off time using a mean value (creates exponential distribution).
- Parameters:
delayOffTime- The mean delay-off time- Returns:
This Task instance for method chaining
-
getSetupTime
Distribution getSetupTime()
-
getSetupTimeMean
double getSetupTimeMean()
-
getSetupTimeSCV
double getSetupTimeSCV()
-
getDelayOffTime
Distribution getDelayOffTime()
-
getDelayOffTimeMean
double getDelayOffTimeMean()
-
getDelayOffTimeSCV
double getDelayOffTimeSCV()
-
getMultiplicity
int getMultiplicity()
-
getReplication
int getReplication()
-
getScheduling
SchedStrategy getScheduling()
-
getThinkTimeMean
double getThinkTimeMean()
-
getThinkTimeSCV
double getThinkTimeSCV()
-
setMultiplicity
void setMultiplicity(int multiplicity)
-
setScheduling
void setScheduling(SchedStrategy scheduling)
-
getPrecedences
List<ActivityPrecedence> getPrecedences()
-
hasSetupDelayoff
boolean hasSetupDelayoff()
Check if this task has setup/delayoff configured (i.e., non-trivial values).
- Returns:
true if setup time or delay-off time is configured with non-immediate values
-
getEntries
List<Entry> getEntries()
Returns the list of entries for this task.
- Returns:
the list of entries
-
getActivities
List<Activity> getActivities()
Returns the list of activities for this task.
- Returns:
the list of activities
-
getProcessor
Processor getProcessor()
Returns the processor (host) that this task runs on.
- Returns:
the parent processor
-
setPriority
Task setPriority(int priority)
-
getPriority
int getPriority()
-
getFanInSource
String getFanInSource()
-
getFanInValue
int getFanInValue()
-
setReplyEntry
Task setReplyEntry(List<Entry> replyEntry)
-
-
-
-