Esempio n. 1
0
        private static Relation[] GetRelations(Parameters parameters, string[] realVariableNames)
        {
            ParameterWithSubParams <int> sp = parameters.GetParamWithSubParams <int>("Number of relations");
            int             nrel            = sp.Value + 1;
            List <Relation> result          = new List <Relation>();
            Parameters      param           = sp.GetSubParameters();

            for (int j = 0; j < nrel; j++)
            {
                string rel = param.GetParam <string>("Relation " + (j + 1)).Value;
                if (rel.StartsWith(">") || rel.StartsWith("<") || rel.StartsWith("="))
                {
                    rel = "x" + rel;
                }
                string   err1;
                Relation r = Relation.CreateFromString(rel, realVariableNames, new string[0], out err1);
                result.Add(r);
            }
            return(result.ToArray());
        }