diff --git a/config/regexp_search_alt_div/default.json b/config/regexp_search_alt_div/default.json new file mode 100644 index 0000000..925b36f --- /dev/null +++ b/config/regexp_search_alt_div/default.json @@ -0,0 +1,98 @@ +{ + "pop_size": 1000, + "growth_factor": 2.0, + "crossover_ratio": 0.5, + "mutation_ratio": 0.45, + "remove_duplicates": true, + + "plugin_dir":"_build/plugins/regexp_search/", + "plugins": + [ + "../selection/Tournament.cmxs", + "../parent_chooser/UniformParentChooser.cmxs", + "creation/RandomCreation.cmxs", + "creation/CreationFromExample.cmxs", + "mutation/RebuildSubtreeMutation.cmxs", + "mutation/ReduceMutation.cmxs", + "crossover/TakeSubtreeCrossover.cmxs", + "crossover/CombineCrossover.cmxs", + "fitness/MultiobjectiveFitness.cmxs", + "simplification/RepeatSimplification.cmxs", + "simplification/GroupChars.cmxs" + ], + + "creation": + [ + { + "proba":0.1, "method":"from_example", + "params": + { + "replacement_patterns": + [ + { "proba":0.5, "regexp":"[A-Z]" }, + { "proba":0.5, "regexp":"[a-z]" }, + { "proba":0.7, "regexp":"[0-9]" }, + { "proba":0.5, "regexp":"[ \t]" }, + { "proba":0.8, "regexp":"[A-Za-z]" }, + { "proba":0.2, "regexp":"." } + ] + } + }, + { "proba":0.4, "method":"fill", "params":"&random_gen" }, + { "proba":0.5, "method":"grow", "params":"&random_gen" } + ], + "mutation": + [ + { "proba":0.7, "method":"rebuild_subtree", "params":"&random_gen" }, + { "proba":0.3, "method":"reduce" } + ], + "crossover": + [ + { "proba":0.9, "method":"take_subtree" }, + { "proba":0.1, "method":"combine", "params":{"alt_proba":0.0} } + ], + "fitness": + { + "method":"multiobjective", + "params": + { + "full_example_score":10.0, + "full_counter_example_score":250.0, + "partial_example_score":5.0, + "partial_counter_example_score":0.0, + "size_score":1.0, + "elim_size":150 + } + }, + "simplifications": + [ + { "schedule":100, "method":"repeat_simplification" }, + { "schedule":100, "method":"group_chars" } + ], + "selection" : { "method":"tournament" }, + "parent_choice": { "method":"uniform" }, + + "&random_gen": + { + "min_init_depth": 3, + "max_init_depth": 7, + "max_depth": 10, + + "concat_proba": 0.55, + "alt_proba": 0.0, + "opt_proba": 0.05, + "plus_proba": 0.05, + "star_proba": 0.05, + "rand_char_proba": 0.25, + "predefined_proba": 0.05, + "predefined_list": + [ + { "proba":0.2, "regexp":"." }, + { "proba":0.3, "regexp":"[A-Za-z]" }, + { "proba":0.1, "regexp":"[A-Z]" }, + { "proba":0.1, "regexp":"[a-z]" }, + { "proba":0.2, "regexp":"[0-9]" }, + { "proba":0.1, "regexp":"[ \t]" } + ] + } +} diff --git a/config/regexp_search_alt_div/strict.json b/config/regexp_search_alt_div/strict.json new file mode 100644 index 0000000..2672950 --- /dev/null +++ b/config/regexp_search_alt_div/strict.json @@ -0,0 +1,98 @@ +{ + "pop_size": 1000, + "growth_factor": 2.0, + "crossover_ratio": 0.5, + "mutation_ratio": 0.45, + "remove_duplicates": true, + + "plugin_dir":"_build/plugins/regexp_search/", + "plugins": + [ + "../selection/Tournament.cmxs", + "../parent_chooser/UniformParentChooser.cmxs", + "creation/RandomCreation.cmxs", + "creation/CreationFromExample.cmxs", + "mutation/RebuildSubtreeMutation.cmxs", + "mutation/ReduceMutation.cmxs", + "crossover/TakeSubtreeCrossover.cmxs", + "crossover/CombineCrossover.cmxs", + "fitness/MultiobjectiveFitness.cmxs", + "simplification/RepeatSimplification.cmxs", + "simplification/GroupChars.cmxs" + ], + + "creation": + [ + { + "proba":0.1, "method":"from_example", + "params": + { + "replacement_patterns": + [ + { "proba":0.5, "regexp":"[A-Z]" }, + { "proba":0.5, "regexp":"[a-z]" }, + { "proba":0.7, "regexp":"[0-9]" }, + { "proba":0.5, "regexp":"[ \t]" }, + { "proba":0.8, "regexp":"[A-Za-z]" }, + { "proba":0.2, "regexp":"." } + ] + } + }, + { "proba":0.4, "method":"fill", "params":"&random_gen" }, + { "proba":0.5, "method":"grow", "params":"&random_gen" } + ], + "mutation": + [ + { "proba":0.7, "method":"rebuild_subtree", "params":"&random_gen" }, + { "proba":0.3, "method":"reduce" } + ], + "crossover": + [ + { "proba":0.9, "method":"take_subtree" }, + { "proba":0.1, "method":"combine", "params":{"alt_proba":0.0} } + ], + "fitness": + { + "method":"multiobjective", + "params": + { + "full_example_score":10.0, + "full_counter_example_score":1000.0, + "partial_example_score":5.0, + "partial_counter_example_score":1.0, + "size_score":1.0, + "elim_size":60 + } + }, + "simplifications": + [ + { "schedule":100, "method":"repeat_simplification" }, + { "schedule":100, "method":"group_chars" } + ], + "selection" : { "method":"tournament" }, + "parent_choice": { "method":"uniform" }, + + "&random_gen": + { + "min_init_depth": 3, + "max_init_depth": 7, + "max_depth": 10, + + "concat_proba": 0.55, + "alt_proba": 0.0, + "opt_proba": 0.05, + "plus_proba": 0.05, + "star_proba": 0.05, + "rand_char_proba": 0.25, + "predefined_proba": 0.05, + "predefined_list": + [ + { "proba":0.2, "regexp":"." }, + { "proba":0.3, "regexp":"[A-Za-z]" }, + { "proba":0.1, "regexp":"[A-Z]" }, + { "proba":0.1, "regexp":"[a-z]" }, + { "proba":0.2, "regexp":"[0-9]" }, + { "proba":0.1, "regexp":"[ \t]" } + ] + } +} diff --git a/implementations/regexp_search/regexp_search_alt_div.ml b/implementations/regexp_search/regexp_search_alt_div.ml index 7ff5189..b083bf0 100644 --- a/implementations/regexp_search/regexp_search_alt_div.ml +++ b/implementations/regexp_search/regexp_search_alt_div.ml @@ -36,7 +36,7 @@ let () = It creates and evolve a population of candidate regular expressions with a genetic algorithm.\n\ All the genetic operators on the population must be provided through plugins loaded dynamically.\n\ You need to provide a configuration file specifying the required plugins and the parameters of the evolution process.\n\ - Usage: regexp-search-alt-d&c [options] configFilename\n\ + Usage: regexp-search-alt-div [options] configFilename\n\ \n\ Options available:" in