Class Activity

All Implemented Interfaces:
Serializable, Copyable

public class Activity extends LayeredNetworkElement
An Activity represents an individual processing step or service operation within a Task in a layered queueing network.

Activities are the fundamental units of work that define what processing happens when a request is served by a task. They encapsulate:

  • Resource demands (CPU time, I/O operations, etc.)
  • Service calls to other tasks (synchronous and asynchronous)
  • Processing logic and execution flow
  • Binding relationships with entries that trigger them

Key characteristics:

  • Host demand: The computational resources required on the processor
  • Service calls: Requests made to other tasks during execution
  • Call ordering: Whether calls are made deterministically or stochastically
  • Entry binding: Which entry point triggers this activity
  • Reply activity: Whether this activity sends replies back to callers

Activities can make both synchronous calls (blocking until response) and asynchronous calls (fire-and-forget) to other task entries. They are connected through ActivityPrecedence relationships to form complex execution graphs.

See Also:
  • Field Details

    • hostDemand

      protected Distribution hostDemand
    • hostDemandMean

      protected double hostDemandMean
    • hostDemandSCV

      protected double hostDemandSCV
    • parent

      protected Task parent
    • boundToEntry

      protected String boundToEntry
    • callOrder

      protected String callOrder
    • syncCallDests

      protected Map<Integer,String> syncCallDests
    • syncCallMeans

      protected Matrix syncCallMeans
    • asyncCallDests

      protected Map<Integer,String> asyncCallDests
    • asyncCallMeans

      protected Matrix asyncCallMeans
    • syncCallGroups

      protected List<Activity.CallGroup> syncCallGroups
      Call groups dispatched by a routing strategy instead of independently. The calls themselves stay in syncCallDests/syncCallMeans so every consumer that ignores dispatch order still sees the same aggregate call means.
    • scheduling

      protected Matrix scheduling
    • thinkTime

      protected Distribution thinkTime
    • thinkTimeMean

      protected double thinkTimeMean
    • thinkTimeSCV

      protected double thinkTimeSCV
    • phase

      protected int phase
  • Constructor Details

  • Method Details

    • getSyncCallGroups

      public List<Activity.CallGroup> getSyncCallGroups()
    • asynchCall

      public Activity asynchCall(Entry asynchCallDest, double asynchCallMean)
    • asynchCall

      public Activity asynchCall(String asynchCallDest, double asynchCallMean)
    • asynchCall

      public Activity asynchCall(Entry asynchCallDest)
    • asynchCall

      public Activity asynchCall(String asynchCallDest)
    • boundTo

      public Activity boundTo(Entry entry)
    • boundTo

      public Activity boundTo(String entry)
    • on

      public Activity on(Task parent)
    • repliesTo

      public Activity repliesTo(Entry entry)
    • setCallOrder

      public Activity setCallOrder(String callOrder)
    • setHostDemand

      public void setHostDemand(double hostDemand)
    • setHostDemand

      public void setHostDemand(Distribution hostDemand)
    • setParent

      public void setParent(Task parent)
    • setThinkTime

      public void setThinkTime(Distribution thinkTime)
    • setThinkTime

      public void setThinkTime(double thinkTime)
    • getThinkTime

      public Distribution getThinkTime()
    • getThinkTimeMean

      public double getThinkTimeMean()
    • getThinkTimeSCV

      public double getThinkTimeSCV()
    • getHostDemand

      public Distribution getHostDemand()
    • getHostDemandMean

      public double getHostDemandMean()
    • getHostDemandSCV

      public double getHostDemandSCV()
    • getCallOrder

      public String getCallOrder()
    • getBoundToEntry

      public String getBoundToEntry()
    • getPhase

      public int getPhase()
      Get the phase number for this activity. Phase 1: activities before the reply is sent Phase 2: activities after the reply is sent (post-reply processing)
      Returns:
      The phase number (1 or 2)
    • setPhase

      public Activity setPhase(int phase)
      Set the phase number for this activity. Phase 1: activities before the reply is sent Phase 2: activities after the reply is sent (post-reply processing)
      Parameters:
      phase - The phase number (must be 1 or 2)
      Returns:
      This activity for method chaining
    • synchCallRoundRobin

      public Activity synchCallRoundRobin(List<Entry> synchCallDests, double synchCallMean)
      Dispatch synchronous calls round-robin over a set of target entries. synchCallMean is the total mean number of calls the activity issues per invocation; successive calls go to the targets in cyclic order, so each target receives synchCallMean/entries.size() of them. The probabilistic model with the same per-target means is the ungrouped equivalent: the group adds the deterministic interleaving, not a different call rate. Only the squashed ("flat") layering can represent this, because under "srvn" the targets never share a submodel.
      Parameters:
      synchCallDests - - the target entries, at least two
      synchCallMean - - total mean calls per invocation
      Returns:
      this activity
    • synchCallJSQ

      public Activity synchCallJSQ(List<Entry> synchCallDests, double synchCallMean)
      Dispatch synchronous calls to the least loaded of a set of target entries. Same contract as synchCallRoundRobin, with the cyclic pointer replaced by join-the-shortest-queue: each call goes to the target task whose station holds the fewest jobs at dispatch time, ties split uniformly. Only the squashed ("flat") layering can represent this, and only a layer solver with state-dependent routing honours it.
      Parameters:
      synchCallDests - - the target entries, at least two
      synchCallMean - - total mean calls per invocation
      Returns:
      this activity
    • recordCallGroup

      public Activity recordCallGroup(RoutingStrategy strategy, List<String> destNames)
      Records the grouping of synchronous calls this activity ALREADY declares. addCallGroup issues the member calls and then records them; the .lqnx reader has read them back as ordinary synch-call elements, so it records the grouping alone and must not issue them a second time.
      Parameters:
      strategy - - the dispatch strategy over the group
      destNames - - the target entry names, at least two
      Returns:
      this activity
    • synchCall

      public Activity synchCall(Entry synchCallDest, double synchCallMean)
    • synchCall

      public Activity synchCall(String synchCallDest, double synchCallMean)
    • synchCall

      public Activity synchCall(Entry synchCallDest)
    • synchCall

      public Activity synchCall(String synchCallDest)
    • getParent

      public Task getParent()
    • getSyncCallDests

      public Map<Integer,String> getSyncCallDests()
    • getSyncCallMeans

      public Matrix getSyncCallMeans()
    • setSyncCallMeans

      public Activity setSyncCallMeans(Matrix syncCallMeans)
    • setSyncCallMeans

      public Activity setSyncCallMeans(double syncCallMean)
    • getAsyncCallDests

      public Map<Integer,String> getAsyncCallDests()
    • getAsyncCallMeans

      public Matrix getAsyncCallMeans()
    • setAsyncCallMeans

      public Activity setAsyncCallMeans(Matrix asyncCallMeans)
    • setAsyncCallMeans

      public Activity setAsyncCallMeans(double asyncCallMean)