public static Answer GenerateAnswer(double[][] optimalTable, List <string> decisionVariables)
        {
            double        zValue = optimalTable[0][optimalTable[0].Length - 1];
            List <string> xbv    = SensitivityAnalysis.IdentifyXbv(optimalTable, decisionVariables);
            List <int>    basicVariableColumnIndices = GetBasicVariableColumnIndices(xbv, decisionVariables);
            List <int>    basicVariableRowIndices    = GetBasicVariableRowIndices(optimalTable, basicVariableColumnIndices);

            double[] rhsValues = GetRHSValues(optimalTable);
            Dictionary <string, double> values = GetBasicVariableValues(rhsValues, basicVariableRowIndices, xbv);

            return(new Answer(zValue, values));
        }
Beispiel #2
0
        private static List <int> FindBasicArtificialVariableIndices(double[][] table, List <int> artificalVariableIndices)
        {
            List <int> indices = new List <int>();

            foreach (var item in artificalVariableIndices)
            {
                double[] values = GetColumnValues(table, item);
                if (SensitivityAnalysis.CheckIfBasicVariable(values))
                {
                    indices.Add(item);
                }
            }
            return(indices);
        }