Commits

Shlomi Fish committed 50987fb

Extract a common constant FCS_NUM_BEFS_WEIGHTS.

It was featured in several places and should be made common.

  • Participants
  • Parent commits d2ee53e

Comments (0)

Files changed (3)

fc-solve/source/cmd_line.c

                  * to 0 so
                  * we won't have partial initialization.
                  * */
-                for (a=0 ; a<5 ; a++)
+                for (a=0 ; a<FCS_NUM_BEFS_WEIGHTS ; a++)
                 {
                     freecell_solver_user_set_a_star_weight(
                         instance,
                         );
                 }
 
-                for (a=0 ; a<5 ; a++)
+                for (a=0 ; a<FCS_NUM_BEFS_WEIGHTS ; a++)
                 {
                     while ((*start_num > '9') && (*start_num < '0') && (*start_num != '\0'))
                     {

fc-solve/source/fcs_enums.h

 #define FCS_METHOD_OPTIMIZE 4
 #define FCS_METHOD_RANDOM_DFS 5
 
+#define FCS_NUM_BEFS_WEIGHTS 5
 
 #ifdef __cplusplus
 }

fc-solve/source/instance.h

                      * The BeFS weights of the different BeFS tests. Those
                      * weights determine the commulative priority of the state.
                      * */
-                    double befs_weights[5];
+                    double befs_weights[FCS_NUM_BEFS_WEIGHTS];
                 } befs;
             } meth;
         } befs;
     STRUCT_CLEAR_FLAG(instance, FCS_RUNTIME_IN_OPTIMIZATION_THREAD);
 }
 
-extern const double fc_solve_default_befs_weights[5];
-
+extern const double fc_solve_default_befs_weights[FCS_NUM_BEFS_WEIGHTS];
 
 #ifdef FCS_RCS_STATES
 fcs_state_t * fc_solve_lookup_state_key_from_val(