Class ComponentBlock
java.lang.Object
solvers.linearSystem.btf.ComponentBlock
- Direct Known Subclasses:
MacroBlock, MicroBlock, SecondaryMacroBlock, TopLevelBlock
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
FieldsModifier and TypeFieldDescriptionprotected CoMoMBasisThe basis of the model under consideration.protected static intThe number of columns that have been output from the current row being printedprotected intThe current class being considered.protected PositionThe coordinate of the top left corner of the blockprotected QNModelThe model under consideration.protected PositionThe dimensions of the block; in the form (rows, columns) -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedComponentBlock(QNModel qnm, CoMoMBasis basis, Position position) The base constructor for any ComponentBlockprotectedComponentBlock(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 TypeMethodDescriptionabstract intaddCE(int position, PopulationChangeVector n, int queue) Adds the appropriate coefficients of a Convolution Expression to the blockabstract intaddPC(int position, PopulationChangeVector n, int _class) Adds the appropriate coefficients of a Population Constraint to the blockintReturns the starting col.intReturns the starting row.abstract voidmultiply(BigRational[] result) Carries out the appropriate matrix multiplication operation for the blockstatic voidnewLine()Starts a new line whilst printing the matrices.abstract voidprintRow2(int row) Prints a line of the block if the contains therow.size()Method size.abstract voidsolve(BigRational[] rhs) Makes the block carry out its role in the solution of the linear system
-
Field Details
-
qnm
The model under consideration. -
basis
The basis of the model under consideration. -
position
The coordinate of the top left corner of the block -
size
The dimensions of the block; in the form (rows, columns) -
cols_printed
protected static int cols_printedThe number of columns that have been output from the current row being printed -
current_class
protected int current_classThe current class being considered.
-
-
Constructor Details
-
ComponentBlock
The base constructor for any ComponentBlock- Parameters:
qnm- The Queueing Network to be consideredbasis- The associate basis of the Modelposition- The position of the top left corner of the block
-
ComponentBlock
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 copycurrent_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
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 therow. 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 relatesqueue- The queue k to which the equation relates; 1 <= k <= M- Returns:
- The row at which the equation was inserted
- Throws:
BTFMatrixErrorExceptionInternalErrorException
-
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:
BTFMatrixErrorExceptionInternalErrorException
-
multiply
Carries out the appropriate matrix multiplication operation for the block- Parameters:
result- Result vector- Throws:
BTFMatrixErrorException
-
solve
public abstract void solve(BigRational[] rhs) throws BTFMatrixErrorException, OperationNotSupportedException, InconsistentLinearSystemException, InternalErrorException 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:
BTFMatrixErrorExceptionOperationNotSupportedExceptionInconsistentLinearSystemExceptionInternalErrorException
-