forked from Wandalen/wTools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Wandalen#1095 from YuliaProkopovych/tsp-results
NOT READY: TSP results
- Loading branch information
Showing
11 changed files
with
476 additions
and
232 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
module/move/optimization_tools/src/optimization/diagram.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
```mermaid | ||
flowchart TB | ||
id1([Begin]) | ||
--> | ||
id2["`Initialize values: | ||
*ga_max_stale_iterations*, | ||
*sa_mutations_per_dynasty_limit*, | ||
*reset_limit*, | ||
*crossover_rate*, | ||
elite_selection_rate, | ||
mutation_rate, | ||
fitness_recalculation, | ||
dynasties_limit, | ||
population_size, | ||
population_percent`"] | ||
--> | ||
id3["`Initialize operators: | ||
*crossover_operator*, | ||
*mutation_operator*, | ||
*selection_operator*, | ||
*temperature_scheduler*, | ||
*population_seeder*;`"] | ||
--> | ||
id4["`Calculate initial values for main loop: | ||
*population* = initial_population, | ||
*dynasties_number* = 1, | ||
*stale_generations* = 0, | ||
*prev_best_fitness = initial_population best individual fitness*, | ||
*temperature* = initial_temperature`"] | ||
-- enter main loop --> | ||
id5{{"`*dynasties_number* > *dynasties_limit* ?`"}} | ||
id5 -->|No| id6{{ population has solution ? }} | ||
id6 -->|No| id7{{"`*stale_populations* > *stale_population_limit* ?`"}} | ||
id7 -->|No| id8{{"`*population_best_fitness* == *prev_best_fitness* ?`"}} | ||
id7 -->|Yes| id9[ Reseed population, reset temperature ] | ||
id9 --> id8 | ||
id8 -->|"No ( There's progress ) "| id10["`*prev_best_fitness* = *population_best_fitness*, *stale_populations* = 0;`"] | ||
id8 -->|"Yes (Stale population) "| id11["`*stale_population* += 1`"] | ||
id10 --> id12[ Initialaize new_population ] | ||
id11 --> id12 | ||
id12 --> id13["`*new_population* = *population.evolve*`"] | ||
id13 -->|check new_population length| id14{{"`*new_population_len* < *population_len*`"}} | ||
id14 -->|Yes| id15[ Clone individuals from old population ] | ||
id14 -->|No| id16["`Update temperature with *temperature_scheduler*, | ||
*population* = *new_population*, | ||
*dynasties_number* += 1;`"] | ||
id15 --> id16 | ||
id16 --> id5 | ||
id6 -->|Yes| id20([End optimization]) | ||
id5 -->|Yes| id20 | ||
``` |
40 changes: 40 additions & 0 deletions
40
module/move/optimization_tools/src/optimization/evolve_method_diagram.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
```mermaid | ||
flowchart TB | ||
id1([Begin]) | ||
--> | ||
id2["`Values initialized in optimizer: | ||
*elite_selection_rate*, | ||
*mutation_rate* = 1, | ||
*crossover_rate* = 0`"] | ||
--> | ||
id4["`Values passed as parameters: | ||
*person*, | ||
*population*, | ||
*tamperature*`"] | ||
-- start --> | ||
id5{{"`*person* is in elites ?`"}} | ||
id5 -->|Yes| id10[ clone person ] | ||
id5 -->|No| id6{{"`rand > *mutation_rate* ?`"}} | ||
id6 -->|No| id7["`use *crossover_operator* `"] | ||
id6 -->|Yes| id8["`use *mutation_operator* `"] | ||
id7 -->id9["`select parents with *selection_operator*`"] | ||
id9 -->id11["`perform crossover`"] | ||
id8 -->id12["`Initialize values | ||
*n_mutations* = 0; | ||
*expected_number_of_mutations* = 4;`"] | ||
id12 -- Enter loop --> id13{{"`*n_mutations* > *mutations_per_dynasty_limit* ?`"}} | ||
id13 -->|Yes| id14["End loop"] | ||
id13 -->|No| id15["`Create *expected_number_of_mutations* candidate persons`"] | ||
id15 -->id17["`Mutate candidates with *mutation_operator*`"] | ||
id17 -->id18{{"` Candidates contain vital candidate ?`"}} | ||
id18 -->|Yes| id14["End loop"] | ||
id18 -->|No| id19["`*n_mutations* += 1; | ||
expected_number_of_mutations += 4;`"] | ||
id19 --> id13 | ||
id11 --> id16([End]) | ||
id14 --> id16 | ||
id10 --> id16 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.