/* $Header: /tmp_mnt/vida/disks/disk5/Users/terry/r/gassy/RCS/main.h,v 1.13 1992/10/09 06:43:50 terry Exp terry $ */ #define BUF_SZ 8192 #define NO_SEED -1L /* Must be <0 for the seeder to pick its own seed. */ #define BEEP '\007' #define INT_STRING ".interrupt." #define DIGITS 6 #define DUMP_SEPARATOR " : " #define STDOUT_INDICATOR "/stdout/" #define SHOW_AVERAGES 0 #define SHOW_BEST_OF_GENERATION 1 #define SHOW_BEST_OF_RUN 2 #define SHOW_HASHING 3 #define SHOW_HASHING_VERBOSE 4 #define SHOW_INTERMEDIATES 5 #define SHOW_FINAL 6 #define SHOW_POPULATIONS 7 #define SHOW_POPULATIONS_SORTED_BY_G 8 #define SHOW_POPULATIONS_SORTED_BY_F 9 #define SHOW_TOTALS 10 #define APP_OUTPUT 11 #define MAIN_OUTPUT 12 #define DUMP_FINAL 13 #define NUM_OUTPUT_FILES 14 /* * The following are horrible, but it is easy to * do them and we require constants in main_options.c */ #define SHOW_AVERAGES_NAME "show_averages" #define SHOW_BEST_OF_GENERATION_NAME "show_best_of_generation" #define SHOW_BEST_OF_RUN_NAME "show_best_of_run" #define SHOW_HASHING_NAME "show_hashing" #define SHOW_HASHING_VERBOSE_NAME "show_hashing_verbose" #define SHOW_INTERMEDIATES_NAME "show_intermediates" #define SHOW_FINAL_NAME "show_final" #define SHOW_POPULATIONS_NAME "show_populations" #define SHOW_POPULATIONS_SORTED_BY_G_NAME "show_populations_sorted_by_g" #define SHOW_POPULATIONS_SORTED_BY_F_NAME "show_populations_sorted_by_f" #define SHOW_TOTALS_NAME "show_totals" #define APP_OUTPUT_NAME "app_output_file" #define MAIN_OUTPUT_NAME "output_file" #define DUMP_FINAL_NAME "dump_final_population" #define SHOW_AVERAGES_ABBR "sa" #define SHOW_BEST_OF_GENERATION_ABBR "sbog" #define SHOW_BEST_OF_RUN_ABBR "sbor" #define SHOW_HASHING_ABBR "sh" #define SHOW_HASHING_VERBOSE_ABBR "shv" #define SHOW_INTERMEDIATES_ABBR "si" #define SHOW_FINAL_ABBR "sf" #define SHOW_POPULATIONS_ABBR "sp" #define SHOW_POPULATIONS_SORTED_BY_G_ABBR "spsg" #define SHOW_POPULATIONS_SORTED_BY_F_ABBR "spsf" #define SHOW_TOTALS_ABBR "st" #define APP_OUTPUT_ABBR "ao" #define MAIN_OUTPUT_ABBR "o" #define DUMP_FINAL_ABBR "df" typedef struct { BOOLEAN enabled; STRING filename; FILE *fp; } OUTPUT_FILE; extern VOID version(); extern VOID print_population(); extern VOID flag_interrupt(); extern VOID dump_state(); extern VOID restore_state(); extern VOID copy_individual(); extern VOID write_individual(); extern VOID set_functions(); extern VOID show_functions(); extern INT find_function(); extern INT read_individual(); extern INT read_population(); extern VOID dump_population(); extern STRING prepare_for_interrupts(); extern STRING set_name(); extern VOID init_output_files(); extern VOID check_main_options(); extern VOID read_initial_population(); extern VOID read_dump_population(); extern VOID allocate_memory(); extern VOID close_output_files(); extern VOID open_output_files(); extern dump_random_state(); extern restore_random_state(); #if defined(APP_HAS_ITS_OWN_SCALING_METHODS) || defined(APP_HAS_ITS_OWN_SURVIVOR_METHODS) || \ defined(APP_HAS_ITS_OWN_CROSSOVER_METHODS) || defined(APP_HAS_ITS_OWN_SELECTION_METHODS) || \ defined(APP_HAS_ITS_OWN_MUTATION_METHODS) extern FUNCTION *merge_functions(); #endif /* This one is defined here as it's not useful to applications. */ #define VCADDR(x) ((VOID *) (&context.x)) #if defined(APP_DUMPS_INDIVIDUALS) #define dump_individual app_dump_individual #else #define dump_individual write_individual #endif