Commits

Shlomi Fish committed 50987fb

Extract a common constant FCS_NUM_BEFS_WEIGHTS.

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

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(
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.