Download hogarth-d-dissertati.. - Department of Computer Science
Transcript
}
}
}
/** This method takes a payoff matrix and
converts it into a Linear programming
tableau */
public static void convertMatrix(){
/** Sets dimensions of LP tableau and creates it */
newRows = numRows + 1;
newCols = numRows + numCols + 2;
newMat = new double[newRows][newCols];
for (int x = 0; x < numRows; x++) {
for (int y = 0; y < numCols; y++){
newMat[x][y] = payMat[x][y];
}
}
for (int x = 0; x < numCols; x++){
newMat[numRows][x] = -1;
}
for (int x = 0; x < numRows; x++){
newMat[x][newCols - 1] = 1;
}
newMat[newRows - 1][newCols - 1] = 0;
for (int x = 0; x < newRows; x++) {
for (int y = numCols; y < (newCols - 1); y++){
if(y - numCols == x){
newMat[x][y] = 1;
}
else{