#============================================================================= # (c) Copyright Arthur L. Corcoran, 1992, 1993. All rights reserved. # # Genetic Algorithm configuration file #============================================================================= #----------------------------------------------------------------------------- # User data file # This information is not used by the GA, however, it is a convenient # way to input a data file name or other information to your application. #----------------------------------------------------------------------------- # user_data datafile #----------------------------------------------------------------------------- # Seed for random number generator # # Usage: rand_seed my_pid # rand_seed number # # my_pid = use system pid as random seed # number = seed for random number generator, a positive integer # # DEFAULT: rand_seed 1 #----------------------------------------------------------------------------- # rand_seed my_pid # rand_seed 1 #----------------------------------------------------------------------------- # The data type of the allele # # Usage: datatype [bit | int | int_perm | real] # # bit = bit string # int = integers # int_perm = permutation of integers # real = real numbers # # DEFAULT: int_perm #----------------------------------------------------------------------------- # datatype bit # datatype int # datatype int_perm # datatype real #----------------------------------------------------------------------------- # How to initialize the pool # # Usage: initpool [random | from_file filename | interactive] # # random = generate at random based on # datatype, chrom_len, & pool_size # from_file = read from a file # filename = the name of the file to read from # interactive = read from stdin # # DEFAULT: initpool random #----------------------------------------------------------------------------- # initpool random # initpool from_file initpool.dat # initpool interactive #----------------------------------------------------------------------------- # Chromosome length, needed when "initpool random" selected # # Usage: chrom_len length # # length = chromosome length, a positive integer # # DEFAULT: chrom_len 10 #----------------------------------------------------------------------------- # chrom_len 25 #----------------------------------------------------------------------------- # Pool size, needed when "initpool random" selected # # Usage: pool_size size # # size = pool size, a positive integer # # DEFAULT: 100 #----------------------------------------------------------------------------- # pool_size 200 #----------------------------------------------------------------------------- # When to stop the GA # # Convergence means when the variance = 0, or equivalently, when # all the fitness values in the pool are identical. # # Iterations means the number of generations for the generational model # and the number of trials for the steady state model. Numbers must # be given as positive integers. It takes roughly pool_size/2 # iterations of the steady state model to equal one iteration of # the generational model. # # Usage: stop_after convergence # stop_after number [use_convergence | ignore_convergence] # # convergence - stop when the GA converges # number - stop after specified number of iterations # use_convergence - will stop early if GA converges (default) # ignore_convergence - WILL NOT stop early even if GA converges # # DEFAULT: stop_after convergence #----------------------------------------------------------------------------- # stop_after convergence # stop_after 500 # stop_after 500 use_convergence # stop_after 500 ignore_convergence #----------------------------------------------------------------------------- # GA Type: # # Usage: ga [generational | steady_state] # # generational = generational GA # steady_state = steady-state GA # # WARNING: This directive has the following side effects: # # GA type Directives set as a side effect # ------------ ------------------------------- # generational selection roulette # replacement append # rp_interval 1 # # steady-state selection rank_biased # replacement by_rank # rp_interval 100 # # DEFAULT: ga generational #----------------------------------------------------------------------------- # ga generational # most commonly used # ga steady_state # used by Genitor #----------------------------------------------------------------------------- # Generation gap: # # The generation gap represents a percentage of the population to copy # (clone) to the new pool at each generation. This only makes sense in # a GA with two pools as in the generational model. A gap of 0.0 # is the traditional generational algorithm. As the gap increases, # it becomes more like a steady-state algorithm. A gap of 1.0 # essentially disables crossover since only reproduction occurs. # # Usage: gap number # # number = generation gap, valid range = [0.0 .. 1.0] # # DEFAULT: gap 0.0 #----------------------------------------------------------------------------- # gap 0.3 #----------------------------------------------------------------------------- # Selection method: # # Usage: selection [roulette | rank_biased | uniform_random] # # roulette = Roulette wheel # rank_biased = Ranked, biased selection as in Genitor # uniform_random = Pick one at random # # DEFAULT: selection roulette #----------------------------------------------------------------------------- # selection roulette # use with generational GA # selection rank_biased # use with steady-state GA # selection uniform_random # experimental #----------------------------------------------------------------------------- # Selection bias # # Usage: bias number # # number = selection bias, valid range = [1.0 .. 2.0] # Only used for rank_biased selection # # DEFAULT: bias 1.8 #----------------------------------------------------------------------------- # bias 1.1 #----------------------------------------------------------------------------- # Crossover method: # # Usage: crossover [simple | uniform | order1 | order2 | position | cycle | # pmx | uox | rox | asexual] # # simple = children get alternate "halves" of parents # uniform = alleles swapped uniformly # order1 = order based # order2 = order based # position = order based # cycle = order based # pmx = order based # uox = uniform order # rox = relative order # asexual = swap two alleles # # DEFAULT: crossover order1 #----------------------------------------------------------------------------- # crossover simple # crossover uniform # crossover order1 # use ony with integer permutations # crossover order2 # use ony with integer permutations crossover position # use ony with integer permutations # crossover cycle # use ony with integer permutations # crossover pmx # use ony with integer permutations # crossover uox # use ony with integer permutations # crossover rox # use ony with integer permutations # crossover asexual #----------------------------------------------------------------------------- # Crossover Rate # # Usage: x_rate number # # number = crossover rate (percentage), valid range = [0.0 .. 1.0] # A crossover rate of 0.0 disables crossover # # DEFAULT: x_rate 1.0 #----------------------------------------------------------------------------- # x_rate 0.6 #----------------------------------------------------------------------------- # Mutation method: # # Usage: mutation [simple_invert | simple_random | swap] # # simple_invert = invert a bit # simple_random = random bit value # swap = swap two alleles # # DEFAULT: mutation swap #----------------------------------------------------------------------------- # mutation simple_invert # use only with bits # mutation simple_random # use only with bits # mutation swap # use with any datatype #----------------------------------------------------------------------------- # Mutation Rate # # Usage: mu_rate number # # number = mutation rate (percentage), valid range = [0.0 .. 1.0] # A mutation rate of 0.0 disables mutation # # DEFAULT: mu_rate 0.0 #----------------------------------------------------------------------------- # mu_rate 0.1 #----------------------------------------------------------------------------- # Replacement method: # # Usage: replacement [append | by_rank | first_weaker | weakest] # # append = append to new pool, as in generational GA # by_rank = insert in sorted order, as in Genitor # first_weaker = replace first weaker found in linear scan of pool # weakest = replace weakest member of the pool # # DEFAULT: replacement append #----------------------------------------------------------------------------- # replacement append # use with roulette (generational GA) # replacement by_rank # use with rank_biased (steady-state GA) # replacement first_weaker # experimental # replacement weakest # experimental #----------------------------------------------------------------------------- # Objective of GA: # # Usage: objective [minimize | maximize] # # minimize = minimize evaluation function # maximize = maximize evaluation function # # DEFAULT: objective minimize #----------------------------------------------------------------------------- # objective minimize # objective maximize #----------------------------------------------------------------------------- # Elitism # # Elitism has two actions. For a generational GA, elitism makes two copies # of the best performer in the old pool and and places them in the new # pool, thus ensuring the most fit chromosome survives. The other action # works with both models. In this case, elitism picks the best two # chromosomes from the parents and children. Thus, if a child is not as # fit as either parent, it will not be placed in the new pool. Selecting # elitism in LibGA performs both actions. # # Usage: elitism [true | false] # # true = ensure best members survive until next generation # false = no guarantee best will survive # # DEFAULT: elitism true #----------------------------------------------------------------------------- # elitism true # elitism false #----------------------------------------------------------------------------- # Report type # # Usage: rp_type [none | minimal | short | long] # # none = output nothing # minimal = output configuration and final result # short = output minimal + statistics only # long = output short + dump pool # # DEFAULT: rp_type short #----------------------------------------------------------------------------- # rp_type none # rp_type minimal # rp_type short # rp_type long #----------------------------------------------------------------------------- # Report interval # # Usage: rp_interval number # # number = interval between reports, a positive integer # # DEFAULT: rp_interval 1 #----------------------------------------------------------------------------- # rp_interval 10 #----------------------------------------------------------------------------- # Output report filename # # Usage: rp_file file_name [file_mode] # # file_name = name of report file # file_mode = optional file mode for fopen() # a = append (DEFAULT) # w = overwrite # # DEFAULT: (write to stdout) #----------------------------------------------------------------------------- # rp_file ga.out # rp_file ga.out a # rp_file ga.out w