示例#1
0
        public int FindIneqIndex(ListHyp hypermap, Label ineqId)
        {
            try
            {
                if (!constraints.ContainsKey(ineqId.name))
                {
                    throw new Exception("Constraint " + ineqId.name + " is not defined in 000.txt");
                }

                Definition      c       = constraints[ineqId.name];
                HypermapElement element = hypermap.Translate(c.domain, ineqId.index);
                if (element == null)
                {
                    throw new Exception(
                              String.Format("Element with the index {0} is not found for the domain {1}", ineqId.index, c.domain));
                }

                return(hypermap.FindElementIndex(c.set, element));
            }
            catch (Exception e)
            {
                throw new Exception(
                          String.Format("Inequality {0} problem: {1}", ineqId.name, e.Message));
            }
        }
示例#2
0
        public int FindIneqIndex(ListHyp hypermap, Label ineqId)
        {
            Definition      c       = constraints[ineqId.name];
            HypermapElement element = hypermap.Translate(c.domain, ineqId.index);

            return(hypermap.FindElementIndex(c.set, element));
        }
示例#3
0
 public HypermapElement TranslateIneq(ListHyp hypermap, Label ineqId)
 {
     try
     {
         string domain = constraints[ineqId.name].domain;
         return(hypermap.Translate(domain, ineqId.index));
     }
     catch (Exception e)
     {
         Console.WriteLine("TranslateIneq() Error: ineqId = {0}", ineqId);
         throw e;
     }
 }
示例#4
0
 /// <summary>
 /// Returns a hypermap element corresponding to the variable name
 /// </summary>
 /// <param name="varName"></param>
 /// <returns></returns>
 public HypermapElement TranslateVariable(ListHyp hypermap, Label varName)
 {
     string domain = variables[varName.name].domain;
     return hypermap.Translate(domain, varName.index);
 }
示例#5
0
 public HypermapElement TranslateIneq(ListHyp hypermap, Label ineqId)
 {
     try
     {
         string domain = constraints[ineqId.name].domain;
         return hypermap.Translate(domain, ineqId.index);
     }
     catch (Exception e)
     {
         Console.WriteLine("TranslateIneq() Error: ineqId = {0}", ineqId);
         throw e;
     }
 }
示例#6
0
        public int FindIneqIndex(ListHyp hypermap, Label ineqId)
        {
            try
            {
                if (!constraints.ContainsKey(ineqId.name))
                    throw new Exception("Constraint " + ineqId.name + " is not defined in 000.txt");

                Definition c = constraints[ineqId.name];
                HypermapElement element = hypermap.Translate(c.domain, ineqId.index);
                if (element == null)
                {
                    throw new Exception(
                           String.Format("Element with the index {0} is not found for the domain {1}", ineqId.index, c.domain));
                }

                return hypermap.FindElementIndex(c.set, element);
            }
            catch (Exception e)
            {
                throw new Exception(
                    String.Format("Inequality {0} problem: {1}", ineqId.name, e.Message));
            }
        }
示例#7
0
        public HypermapElement TranslateIneq(ListHyp hypermap, Label ineqId)
        {
            string domain = constraints[ineqId.name].domain;

            return(hypermap.Translate(domain, ineqId.index));
        }
示例#8
0
        /// <summary>
        /// Returns a hypermap element corresponding to the variable name
        /// </summary>
        /// <param name="varName"></param>
        /// <returns></returns>
        public HypermapElement TranslateVariable(ListHyp hypermap, Label varName)
        {
            string domain = variables[varName.name].domain;

            return(hypermap.Translate(domain, varName.index));
        }
示例#9
0
 public HypermapElement TranslateIneq(ListHyp hypermap, Label ineqId)
 {
     string domain = constraints[ineqId.name].domain;
     return hypermap.Translate(domain, ineqId.index);
 }
示例#10
0
 public int FindIneqIndex(ListHyp hypermap, Label ineqId)
 {
     Definition c = constraints[ineqId.name];
     HypermapElement element = hypermap.Translate(c.domain, ineqId.index);
     return hypermap.FindElementIndex(c.set, element);
 }