static void Main(string[] args) { double[,] newMatrix = { { 7, 5, 5, 1, 6 }, { 2, 3, 4, 2, 5 }, { 6, 3, 2, 4, 4 }, { 3, 5, 5, 7, 7 }, { 7, 2, 4, 3, 2 }, { 5, 4, 7, 5, 3 }, { 4, 3, 4, 3, 4 }, { 3, 4, 4, 5, 5 } }; Playoff playoff = new Playoff(newMatrix); Risk risk = Converter.fromPlayoffToRisk(playoff); double[] currentState = { 0.2, 0.1, 0.3, 0.3, 0.1 }; risk.addStateOfNature(currentState); double min = risk.findMaxExperimentPrice(); Console.WriteLine($"{min}"); }
public static Risk fromPlayoffToRisk(Playoff playoff) { int n = playoff.Matrix.GetLength(0); int m = playoff.Matrix.GetLength(1); //Creating risk matrix the same size as playoff double[,] riskMatrix = new double[n, m]; for (int j = 0; j < m; j++) { //Finding maximum value in current row double rowMax = playoff.findMaxValueInRow(j); for (int i = 0; i < n; i++) { riskMatrix[i, j] = rowMax - playoff.Matrix[i, j]; } } Risk risk = new Risk(riskMatrix); return(risk); }