Class ComponentBlock

java.lang.Object
solvers.linearSystem.btf.ComponentBlock
Direct Known Subclasses:
MacroBlock, MicroBlock, SecondaryMacroBlock, TopLevelBlock

public abstract class ComponentBlock extends Object
This class defines fields that all component blocks of the linear system must have, and provides the interface they must all implement.
Author:
Jack Bradshaw
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected CoMoMBasis
    The basis of the model under consideration.
    protected static int
    The number of columns that have been output from the current row being printed
    protected int
    The current class being considered.
    protected Position
    The coordinate of the top left corner of the block
    protected QNModel
    The model under consideration.
    protected Position
    The dimensions of the block; in the form (rows, columns)
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    ComponentBlock(QNModel qnm, CoMoMBasis basis, Position position)
    The base constructor for any ComponentBlock
    protected
    ComponentBlock(ComponentBlock block, int current_class)
    Copy Constructor - Shallow Copy Returns a block with the same QNModel, Basis and position and sets is current working class.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract int
    addCE(int position, PopulationChangeVector n, int queue)
    Adds the appropriate coefficients of a Convolution Expression to the block
    abstract int
    addPC(int position, PopulationChangeVector n, int _class)
    Adds the appropriate coefficients of a Population Constraint to the block
    int
    Returns the starting col.
    int
    Returns the starting row.
    abstract void
    Carries out the appropriate matrix multiplication operation for the block
    static void
    Starts a new line whilst printing the matrices.
    abstract void
    printRow2(int row)
    Prints a line of the block if the contains the row.
    Method size.
    abstract void
    Makes the block carry out its role in the solution of the linear system

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • qnm

      protected QNModel qnm
      The model under consideration.
    • basis

      protected CoMoMBasis basis
      The basis of the model under consideration.
    • position

      protected Position position
      The coordinate of the top left corner of the block
    • size

      protected Position size
      The dimensions of the block; in the form (rows, columns)
    • cols_printed

      protected static int cols_printed
      The number of columns that have been output from the current row being printed
    • current_class

      protected int current_class
      The current class being considered.
  • Constructor Details

    • ComponentBlock

      protected ComponentBlock(QNModel qnm, CoMoMBasis basis, Position position)
      The base constructor for any ComponentBlock
      Parameters:
      qnm - The Queueing Network to be considered
      basis - The associate basis of the Model
      position - The position of the top left corner of the block
    • ComponentBlock

      protected ComponentBlock(ComponentBlock block, int current_class)
      Copy Constructor - Shallow Copy Returns a block with the same QNModel, Basis and position and sets is current working class.
      Parameters:
      block - The block to copy
      current_class - The current class under consideration
  • Method Details

    • getStartingCol

      public int getStartingCol()
      Returns the starting col.
      Returns:
      The first column contained in this block
    • getStartingRow

      public int getStartingRow()
      Returns the starting row.
      Returns:
      The first row contained in this block
    • size

      public Position size()
      Method size.
      Returns:
      The Dimensions of the block, in the form (rows, columns)
    • printRow2

      public abstract void printRow2(int row)
      Prints a line of the block if the contains the row. The number of columns printed for the current row is incremented accordingly.
      Parameters:
      row - The absolute row of the overall matrix to be printed.
    • newLine

      public static void newLine()
      Starts a new line whilst printing the matrices.
    • addCE

      public abstract int addCE(int position, PopulationChangeVector n, int queue) throws BTFMatrixErrorException, InternalErrorException
      Adds the appropriate coefficients of a Convolution Expression to the block
      Parameters:
      position - Carries information on where to insert the equation depending on the context (can be interpreted differently by subclasses)
      n - The Population Change Vector n to which the equation relates
      queue - The queue k to which the equation relates; 1 <= k <= M
      Returns:
      The row at which the equation was inserted
      Throws:
      BTFMatrixErrorException
      InternalErrorException
    • addPC

      public abstract int addPC(int position, PopulationChangeVector n, int _class) throws BTFMatrixErrorException, InternalErrorException
      Adds the appropriate coefficients of a Population Constraint to the block
      Parameters:
      position - Carries information on where to insert the equation depending on the context (can be interpreted differently by subclasses)
      n - The Population Change Vector n to which the equation relates
      _class - The class r to which the equation relates; 1 <= r <= R
      Returns:
      The row at which the equation was inserted
      Throws:
      BTFMatrixErrorException
      InternalErrorException
    • multiply

      public abstract void multiply(BigRational[] result) throws BTFMatrixErrorException
      Carries out the appropriate matrix multiplication operation for the block
      Parameters:
      result - Result vector
      Throws:
      BTFMatrixErrorException
    • solve

      Makes the block carry out its role in the solution of the linear system
      Parameters:
      rhs - The intermediate basis used during the computation of the solution
      Throws:
      BTFMatrixErrorException
      OperationNotSupportedException
      InconsistentLinearSystemException
      InternalErrorException