Lines Matching +full:has +full:- +full:flag
2 # Use of this source code is governed by a BSD-style license that can be
14 from flags import Flag
27 first_flag: The first gene (Flag) to cross over with.
28 second_flag: The second gene (Flag) to cross over with.
31 A Flag that can be considered appropriately randomly blended between the
32 first and second input flag.
42 specs: A list of spec from which the flag set is created.
43 flag_set: The current flag set being mutated
47 A Genetic Task constructed by randomly mutating the input flag set.
53 # Randomly choose whether this flag should be mutated.
57 # If the flag is not already in the flag set, it is added.
59 results_flags.append(Flag(spec))
62 # If the flag is already in the flag set, it is mutated.
65 # The value of a numeric flag will be changed, and a boolean flag will be
72 # Randomly select a nearby value of the current value of the flag.
77 rand_arr.append(value - 1)
80 # If the value is smaller than the start of the spec, this flag will be
82 if value != int(numeric_flag_match.group("start")) - 1:
83 results_flags.append(Flag(spec, value))
97 specs: A list of spec from which the flag set is created.
99 random version of the same flag, instead of one from either of the
106 # Get the flag dictionary.
135 # flag from either parent.
136 for flag in common_flags:
138 CrossoverWith(father_flags[flag], mother_flags[flag])
151 # The value checks whether the algorithm has converged and arrives at a fixed
159 # The value checks whether the algorithm has converged and arrives at a fixed
177 stop_threshold: The number of generations, upon which no performance has
180 num_trials: The number of trials, upon which new task has been tried to
208 """True if this generation has improvement upon its parent generation."""
217 # Found out whether a task has improvement upon the best task in the
222 # At least one task has improvement.