The number of rows in the reservation table.
nCols
private int nCols
The number of columns in the reservation table.
table
private int table[][]
A 2-dimensional integer array that is used to represent the reservation table.
pcv
private int pcv[]
The pipeline collision vector.
modified
private boolean modified
A variable that is used to signfy if the reservation table has been changed or not.
Creates a table with specified rows and columns.
Put a 1 in the 2-dimensional array at the position specified by the method parameters
unmark
public void unmark(int i, int j)
Put a 0 in the 2-dimensional array at the position specified by the method parameters.
getValue
public int getValue(int i, int j)
Returns the value of the 2-dimensional integer array at the position specified by the method parameters.
setModified
public void setModified(boolean value)
Sets the value for the modified variable.
isModified
public boolean isModified()
Returns true if the reservation table has been modified.
collision
public boolean collision(int x, int y, int[][] m)
Check if there is a collision between table 'm' and the current table.
collision
public boolean collision(int shift, int[][] m)
Check if there is a collision between current table with the shifted matrix.
getPCV
public int[] getPCV()
Returns the pcv for the current table.
getPCVString
public String getPCVString()
Returns the pcv for the current table as a String object.
after
public int[] after(int m[][])
Returns the PCV given a reservation table
For example:
If the current reservation table is A and the paramter passed in represents
reservation table B then this function
will return the PCV for A after B
getCols
public int getCols()
Returns the number of columns in the table.
getCols
public int getRows()
Returns the number of rows in the table.
getTable
public int[][] getTable()
Returns the 2-dimensional representation of the table.
isEqual
public boolean isEqual(Table t)
Returns
true if the current table has the same elements as Table t.