Class LayeredNetworkElement

java.lang.Object
jline.lang.Element
jline.lang.layered.LayeredNetworkElement
All Implemented Interfaces:
Serializable, Copyable
Direct Known Subclasses:
Activity, Entry, Host, Task

public class LayeredNetworkElement extends Element
Element of a LayeredNetwork model
See Also:
  • Field Details

    • ACTIVITY

      public static final int ACTIVITY
      See Also:
    • CALL

      public static final int CALL
      See Also:
    • ENTRY

      public static final int ENTRY
      See Also:
    • HOST

      public static final int HOST
      See Also:
    • PROCESSOR

      public static final int PROCESSOR
      See Also:
    • TASK

      public static final int TASK
      See Also:
    • model

      public LayeredNetwork model
    • linConA

      public Matrix linConA
      Matrix(C,K): admission constraint matrix on this server's layer station.
    • linConB

      public Matrix linConB
      Matrix(C,1): admission constraint capacities.
    • linConRows

      Rows declared by operand name, resolved in LayeredNetwork.getStruct.
    • lldScaling

      public Matrix lldScaling
      Vector alpha(n): rate scaling of this server's layer station when it holds n jobs.
    • lcdScaling

      public SerializableFunction<Matrix,Matrix> lcdScaling
      Handle beta(n): product-form class-dependent scaling, n counted over this server's operands.
    • lcdScalingPeak

      public Matrix lcdScalingPeak
      Peak rate scaling per operand of lcdScaling, normalizes Util = T*S/peak.
    • ljdScaling

      public SerializableFunction<Matrix,Matrix> ljdScaling
      Handle eta(n): non-product-form joint-dependent scaling, n counted over this server's operands.
    • ljdScalingPeak

      public Matrix ljdScalingPeak
      Peak rate scaling per operand of ljdScaling, normalizes Util = T*S/peak.
    • serverPools

      Heterogeneous server pools with a compatibility graph over this server's operands. Each entry is one declared pool; SolverLN lowers the whole list to the activated-server rate of SnCompatRate, carried onto the layer station as a joint dependence.
  • Constructor Details

    • LayeredNetworkElement

      public LayeredNetworkElement(String name)
  • Method Details

    • addConstraint

      public void addConstraint(List<? extends LayeredNetworkElement> operands, double[] coeffs, double cap)

      Appends one admission constraint row naming its operands, so the meaning does not depend on declaration order:

         t2.addConstraint(Arrays.asList(e2, e3), new double[]{1, 1}, 2); // n(E2) + n(E3) <= 2
       

      Operands are the entries of a Task, or the tasks of a Host. Names are resolved against the model in LayeredNetwork.getStruct, where an operand that does not belong to this server is an error rather than a silent mis-mapping.

      Parameters:
      operands - entries of this task, or tasks on this host
      coeffs - one coefficient per operand, or null for all ones
      cap - right-hand side of the row
    • addConstraintByName

      public void addConstraintByName(List<String> names, double[] coeffs, double cap)
      Name-based form of addConstraint(List, double[], double), for operands not yet held as handles.
      Parameters:
      names - operand names, entries of this task or tasks on this host
      coeffs - one coefficient per operand, or null for all ones
      cap - right-hand side of the row
    • setConstraint

      public void setConstraint(Matrix A, Matrix b)

      Raw form of addConstraint, for programmatic construction. Declares A*n <= b on the station that represents this server in its layer, where n counts the jobs in service or queueing at that station.

      Columns of A are indexed positionally by the entries of a Task, or by the tasks of a Host, in declaration order, so the mapping shifts if an entry is added later; prefer addConstraint, which names its operands. Only the column count is checked, in LayeredNetwork.getStruct, since entries may be added after this call. Rows from both forms are concatenated.

      Parameters:
      A - constraint matrix, one column per entry or task
      b - capacity vector, one entry per row of A
    • getLinearConstraints

      public Matrix[] getLinearConstraints()
      Positional constraint pair declared on this element, before name resolution.
      Returns:
      a two-element array holding A and b, either of which may be null
    • hasLinearConstraints

      public boolean hasLinearConstraints()
      Whether this element declares any admission constraint, in either form.
      Returns:
      true if a positional pair or at least one named row is present
    • setLoadDependence

      public void setLoadDependence(Matrix alpha)

      Sets the service-rate scaling of the station that represents this server in its layer: alpha[n] applies when that station holds n jobs in total, as in Queue.setLoadDependence. The scaling multiplies the station rate on top of its multiplicity, so a multi-server host applies min(n,m)*alpha[n].

      Parameters:
      alpha - row vector of positive scalings, indexed by station population
    • setClassDependence

      public void setClassDependence(SerializableFunction<Matrix,Matrix> beta, Matrix peakRatePerOperand)

      Sets a class-dependent service-rate scaling on this server's layer station. The handle takes the per-operand population vector of this server: entry j counts the jobs held on behalf of operand j, which is task j of a Host or entry j of a Task, in the same tasksof/entriesof order as the columns of setConstraint. It returns a 1x1 scaling shared by every operand, or a per-operand row vector.

      Product form holds only where an operand occupies the layer station through a single job class; otherwise SolverLN emits the equivalent joint dependence, which is numerically identical but carries no exactness guarantee.

      Parameters:
      beta - maps the per-operand population vector to a rate scaling
      peakRatePerOperand - 1x1 (broadcast) or per-operand peak rate scaling
    • setJointDependence

      public void setJointDependence(SerializableFunction<Matrix,Matrix> eta, Matrix peakRatePerOperand)

      Sets a joint-dependent (non-product-form) service-rate scaling on this server's layer station. The handle reads the per-operand population vector arbitrarily (e.g. min(n[0],c)), so solvers treat it as an approximation. Operand order and the required peak rate are as in setClassDependence(jline.util.SerializableFunction<jline.util.matrix.Matrix, jline.util.matrix.Matrix>, jline.util.matrix.Matrix).

      Parameters:
      eta - maps the per-operand population vector to a rate scaling
      peakRatePerOperand - 1x1 (broadcast) or per-operand peak rate scaling
    • addServerType

      public void addServerType(ServerType serverType)
      Declares one pool of serverType.getNumOfServers() identical servers, each running at serverType.getRate(), eligible only for the operands the ServerType names.

      The operands are the tasks of a Processor, or the entries of a Task. They are resolved against the model in LayeredNetwork.getStruct, where an operand that does not belong to this server is an error rather than a silent mis-mapping, exactly as for an admission constraint.

      SolverLN lowers the whole declaration to the activated-server rate of SnCompatRate, carried onto the layer station as a joint dependence, so the pools are an APPROXIMATION in a layer for the same reason setJointDependence is.

      Parameters:
      serverType - the pool to declare
    • getServerTypes

      public List<LayeredNetworkElement.ServerPool> getServerTypes()
      Declared compatibility pools.
    • hasServerPools

      public boolean hasServerPools()
      Whether this element declares compatibility pools.
    • hasRateDependence

      public boolean hasRateDependence()
      Whether this element declares any service-rate dependence.
      Returns:
      true if a load, class or joint dependence is present