Class Task

All Implemented Interfaces:
Serializable, Copyable
Direct Known Subclasses:
CacheTask, FunctionTask

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.

See Also:
  • Field Details

    • parent

      protected Processor parent
    • multiplicity

      protected int multiplicity
    • replication

      protected int replication
    • scheduling

      protected SchedStrategy scheduling
    • priority

      protected int priority
    • fanInSource

      protected String fanInSource
    • fanInValue

      protected int fanInValue
    • fanOutMap

      protected Map<String,Integer> fanOutMap
    • thinkTime

      protected Distribution thinkTime
    • thinkTimeMean

      protected double thinkTimeMean
    • thinkTimeSCV

      protected double thinkTimeSCV
    • setupTime

      protected Distribution setupTime
    • setupTimeMean

      protected double setupTimeMean
    • setupTimeSCV

      protected double setupTimeSCV
    • delayOffTime

      protected Distribution delayOffTime
    • delayOffTimeMean

      protected double delayOffTimeMean
    • delayOffTimeSCV

      protected double delayOffTimeSCV
    • entries

      protected List<Entry> entries
    • activities

      protected List<Activity> activities
    • precedences

      protected List<ActivityPrecedence> precedences
  • Constructor Details

  • Method Details

    • addActivity

      public Task addActivity(Activity newActivity)
    • addEntry

      public Task addEntry(Entry newEntry)
    • addPrecedence

      public Task addPrecedence(ActivityPrecedence newPrec)
    • addPrecedence

      public Task addPrecedence(List<ActivityPrecedence> newPrec)
    • addPrecedence

      public Task addPrecedence(ActivityPrecedence[] newPrec)
    • getMeanHostDemand

      public double getMeanHostDemand(String entryName)
    • on

      public Task on(Processor parent)
    • removeActivity

      public Task removeActivity(int index)
    • setActivity

      public Task setActivity(Activity newActivity, int index)
    • setAsReferenceTask

      public Task setAsReferenceTask()
    • setReplication

      public Task setReplication(int replication)
    • setReplyEntry

      public Task setReplyEntry(List<Entry> replyEntry)
    • setThinkTime

      public Task setThinkTime(Distribution thinkTime)
    • setThinkTime

      public Task setThinkTime(double thinkTime)
    • setSetupTime

      public 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

      public 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

      public 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

      public 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

      public Distribution getSetupTime()
    • getSetupTimeMean

      public double getSetupTimeMean()
    • getSetupTimeSCV

      public double getSetupTimeSCV()
    • getDelayOffTime

      public Distribution getDelayOffTime()
    • getDelayOffTimeMean

      public double getDelayOffTimeMean()
    • getDelayOffTimeSCV

      public double getDelayOffTimeSCV()
    • getMultiplicity

      public int getMultiplicity()
    • getReplication

      public int getReplication()
    • getScheduling

      public SchedStrategy getScheduling()
    • getThinkTimeMean

      public double getThinkTimeMean()
    • getThinkTimeSCV

      public double getThinkTimeSCV()
    • getParent

      public Host getParent()
    • setMultiplicity

      public void setMultiplicity(int multiplicity)
    • setScheduling

      public void setScheduling(SchedStrategy scheduling)
    • getPrecedences

      public List<ActivityPrecedence> getPrecedences()
    • hasSetupDelayoff

      public 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

      public List<Entry> getEntries()
      Returns the list of entries for this task.
      Returns:
      the list of entries
    • getActivities

      public List<Activity> getActivities()
      Returns the list of activities for this task.
      Returns:
      the list of activities
    • getProcessor

      public Processor getProcessor()
      Returns the processor (host) that this task runs on.
      Returns:
      the parent processor
    • setPriority

      public Task setPriority(int priority)
    • getPriority

      public int getPriority()
    • setFanIn

      public Task setFanIn(String source, int value)
    • getFanInSource

      public String getFanInSource()
    • getFanInValue

      public int getFanInValue()
    • setFanOut

      public Task setFanOut(String dest, int value)
    • getFanOutMap

      public Map<String,Integer> getFanOutMap()