86 |
|
static final int MIN_STRAND_LENGTH = 3; |
87 |
|
|
88 |
|
/** |
89 |
< |
* The probablility mask value for creating random strands, |
89 |
> |
* The probability mask value for creating random strands, |
90 |
|
* that have lengths at least MIN_STRAND_LENGTH, and grow |
91 |
|
* with exposnential decay 2^(-(1/(RANDOM_STRAND_MASK + 1) |
92 |
|
* Must be 1 less than a power of two. |
94 |
|
static final int RANDOM_STRAND_MASK = 7; |
95 |
|
|
96 |
|
/** |
97 |
< |
* Probablility control for selecting breeders. |
97 |
> |
* Probability control for selecting breeders. |
98 |
|
* Breeders are selected starting at the best-fitness chromosome, |
99 |
< |
* with exponentially decaying probablility |
99 |
> |
* with exponentially decaying probability |
100 |
|
* 1 / (subpopSize >>> BREEDER_DECAY). |
101 |
|
* |
102 |
|
* Larger values usually cause faster convergence but poorer |
105 |
|
static final int BREEDER_DECAY = 1; |
106 |
|
|
107 |
|
/** |
108 |
< |
* Probablility control for selecting dyers. |
108 |
> |
* Probability control for selecting dyers. |
109 |
|
* Dyers are selected starting at the worst-fitness chromosome, |
110 |
< |
* with exponentially decaying probablility |
110 |
> |
* with exponentially decaying probability |
111 |
|
* 1 / (subpopSize >>> DYER_DECAY) |
112 |
|
* |
113 |
|
* Larger values usually cause faster convergence but poorer |
448 |
|
|
449 |
|
/** |
450 |
|
* Choose a chromosome that will be replaced, with |
451 |
< |
* exponentially decreasing probablility starting at |
451 |
> |
* exponentially decreasing probability starting at |
452 |
|
* worst, ignoring the excluded index |
453 |
|
* @param exclude index to ignore; use -1 to not exclude any |
454 |
|
* @return index of selected dyer |