Пример #1
0
        // Formata a resposta para cada tipo de solucao possivel
        public ObjectiveFunction GenerateSolution(ObjectiveFunction.RespType solutionType)
        {
            var resp = new ObjectiveFunction(objectiveFunction.Type)
            {
                Solution = solutionType
            };
            var value = table[0, 0].Item1;

            if (objectiveFunction.Type == ObjectiveFunction.FuncType.Max)
            {
                value = value * -1;
            }
            resp.Add("Z", value);
            for (int i = 1; i < linePositions.GetLength(0); i++)
            {
                resp.Add(linePositions[i], table[i, 0].Item1);
            }
            for (int i = 1; i < columnPositions.GetLength(0); i++)
            {
                resp.Add(columnPositions[i], 0);
            }
            return(resp);
        }