Skip to content

Commit

Permalink
Add configuration files for the alt-div version of regexp-search
Browse files Browse the repository at this point in the history
  • Loading branch information
Sakarah committed May 30, 2017
1 parent 42fcc13 commit fbec502
Show file tree
Hide file tree
Showing 3 changed files with 197 additions and 1 deletion.
98 changes: 98 additions & 0 deletions config/regexp_search_alt_div/default.json
Original file line number Diff line number Diff line change
@@ -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]" }
]
}
}
98 changes: 98 additions & 0 deletions config/regexp_search_alt_div/strict.json
Original file line number Diff line number Diff line change
@@ -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]" }
]
}
}
2 changes: 1 addition & 1 deletion implementations/regexp_search/regexp_search_alt_div.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fbec502

Please sign in to comment.