Skip to content

Commit

Permalink
fixed description in crossover
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderdittrich committed Mar 11, 2024
1 parent b8d7565 commit 6024348
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion exercise_1_ga/genetic_algorithm.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@
"Implement the `stochastic_one_point_crossover`-function to perform a one-point crossover on chromosomes.\n",
"1. **Select a Crossover Point:** Choose a random index `idx` along the chromosome that will serve as the point for slicing and recombining the genetic material.\n",
"2. **Recombine to form new chromosomes:** Use the chosen index to interchange segments between two chromosomes, producing two unique offspring, as depicted in the provided figure.\n",
"3. **Introduce Stochastic Crossover:** Implement a probability check for performing the crossover, determined by a `cross_probability` parameter. If a randomly generated number is lower than this probability, the crossover is skipped, and the original parents are returned unchanged as children. If the number is higher, proceed with the crossover.\n",
"3. **Introduce Stochastic Crossover:** Implement a probability check for performing the crossover, determined by a `cross_probability` parameter. If a randomly generated number is higher than this probability, the crossover is skipped, and the original parents are returned unchanged as children. If the number is lower, proceed with the crossover.\n",
"\n",
"`parent_1` and `parent_2` stores each the parameter / genotype vector as 1D array. `cross_probability` is a float number between 0 and 1 $[0, 1]$. \n",
"\n",
Expand Down

0 comments on commit 6024348

Please sign in to comment.