コード例 #1
0
 /**
  * Create a search strategy which selects the variables to branch on with <code>VAR_SELECTOR
  * </code>, then select the value closest to the middle value of its domain, and split its domain
  * into two intervals (binary decisions will be used). If <code>LOWERFIRST</code> is set to true,
  * the domain is restricted to the left interval first. If <code>LOWERFIRST</code> is set to
  * false, the domain is restricted to the right interval first.
  *
  * @param VAR_SELECTOR a variable selector
  * @param LOWERFIRST set to true to select first the left interval, false otherwise
  * @param VARS variables to branch on
  * @return a dichotomic strategy for IntVar
  */
 public static IntStrategy dichotomic(
     VariableSelector<IntVar> VAR_SELECTOR, boolean LOWERFIRST, IntVar... VARS) {
   if (LOWERFIRST) {
     return custom(
         VAR_SELECTOR, ISF.mid_value_selector(LOWERFIRST), DecisionOperator.int_split, VARS);
   } else {
     return custom(
         VAR_SELECTOR,
         ISF.mid_value_selector(LOWERFIRST),
         DecisionOperator.int_reverse_split,
         VARS);
   }
 }
コード例 #2
0
 /**
  * Splits the domain of the first non-instantiated variable in the middle and branch first on the
  * left interval
  *
  * @param VARS list of variables
  * @return int strategy based on domain splits
  */
 public static IntStrategy lexico_Split(IntVar... VARS) {
   return dichotomic(ISF.lexico_var_selector(), true, VARS);
 }