Ejemplo n.º 1
0
 /**
  * Set the current value to the previous value in the domain,
  * or to the last one if we reach the domain lower bound.
  */
 public void UnshiftValue()
 {
     if (IndexDomain >= 0)
     {
         IndexDomain = IndexDomain > 0 ? IndexDomain - 1 : Domain.GetSize() - 1;
     }
 }
Ejemplo n.º 2
0
 /**
  * Set the current value to the next value in the domain,
  * or to the first one if we reach the domain upper bound.
  */
 public void ShiftValue()
 {
     if (IndexDomain >= 0)
     {
         IndexDomain = IndexDomain < Domain.GetSize() - 1 ? IndexDomain + 1 : 0;
     }
 }
Ejemplo n.º 3
0
        /**
         * To know what values are in the current domain.
         * @return a List<int> of values belonging to the variable domain.
         */
        public List <int> PossibleValues()
        {
            var possibleValues = new List <int>();

            for (int i = 0; i < Domain.GetSize(); ++i)
            {
                possibleValues.Add(Domain.GetValue(i));
            }

            return(possibleValues);
        }
Ejemplo n.º 4
0
 /**
  * To know what values are in the current domain.
  * @return a List<int> of values belonging to the variable domain.
  */
 public List <int> PossibleValues()
 {
     return(Enumerable.Range(0, Domain.GetSize())
            .Select(i => Domain.GetValue(i))
            .ToList());
 }