Пример #1
0
        private void ParseContraints(string[] strings, LpFile result)
        {
            var parser = new TermParser();

            for (int i = 1; i < strings.Length; i++)
            {
                var constraint = parser.Parse(strings[i]);
                result.Constraints.Add(constraint);
            }
        }
Пример #2
0
        private void ParseObjectiveFuntion(string line, LpFile result)
        {
            if (line.Contains(':'))
            {
                if (line.Substring(0, line.IndexOf(":")) == "max")
                {
                    result.Type = OptimizationType.Max;
                }

                line = line.Substring(line.IndexOf(":") + 1);
            }

            var parser = new TermParser();

            result.Objective = parser.Parse(line);
        }