Commit Graph

42 Commits

Author SHA1 Message Date
e54824238b Ensure sorted not needed.
The problem was not appending old chromosomes to the front of the next population during survivor selection.
2020-11-27 19:13:37 -05:00
a87103b80c Added ensure_sorted decorator.
Ensures elitism occurs.
2020-11-27 19:08:05 -05:00
f21512f178 Fixed random_avoid_best 2020-11-27 18:40:58 -05:00
1ba86c0661 Cleaned up spacing 2020-11-26 21:30:49 -05:00
243d0dd1a0 Error checking and avoid creating new chromosome for mutation 2020-11-23 11:53:46 -05:00
c8985f9872 Opted for single _ instead of double _ 2020-11-22 17:55:58 -05:00
261870d702 Update mutation_methods.py
- Using deepcopy to avoid chromosomes sharing genes.
- Improved readibility.
2020-11-22 15:57:00 -05:00
815dc2a5c3 Potentially faster list 2020-11-21 16:14:10 -05:00
470b33aa31 Cleaner random functions used. 2020-11-20 19:58:25 -05:00
73461f7915 Comments updated 2020-11-20 19:06:55 -05:00
965ad352a6 Added copies for external access of function decorators 2020-11-19 23:25:33 -05:00
3d10adb2d9 Fixed scope of function decorators 2020-11-19 22:28:04 -05:00
0bd08b94a9 Added function decorators 2020-11-19 21:16:51 -05:00
3412c05da2 Cleaned up list usage 2020-11-19 18:02:07 -05:00
7511429228 Shortened code 2020-11-19 17:14:14 -05:00
0ee545429c Added iterable features 2020-11-19 11:46:47 -05:00
f1105f4df0 Added comment 2020-11-19 09:53:42 -05:00
7e0134e785 Fixed bug
Potentially 0 mutations occur
2020-11-12 18:46:09 -05:00
ef5f87cbc6 Fixed bug 2020-11-12 17:59:55 -05:00
0c9c545125 Cleaned up code 2020-11-12 17:50:07 -05:00
45316286c0 Added Permutation class 2020-11-12 17:38:10 -05:00
3e9c2fc784 Multiple updates
- Removed obsolete whole_chromosome method.
- Renamed single_gene to individual_genes.
- Rewrote single_genes to use copied data instead of modifying original data.
- Added random_selection_then_cross.
2020-11-12 17:13:23 -05:00
00af4dbbe7 Added gene mutation rate 2020-10-27 17:32:40 -04:00
543b295e52 Updated gene impl 2020-10-14 23:09:55 -04:00
fb213f04dd Added more structure methods and some quality of life changes
Overall cleaned up a lot of comments.

EasyGA:
- Code cleanup.

Population:
- Added sort_by_best_fitness
- Added parent/mating pool methods.
- Renamed some methods for consistency.

Chromosome:
- Added get_gene(index).

Parent Selection:
- Improved selection methods to use the ga.selection_probability so that the roulette selection actually works well.
- Added stochastic selection.

Survivor Selection:
- Added fill_in_random and fill_in_parents_then_random.

Crossover/Mutation:
- Cleaned up code.
2020-10-13 12:48:20 -04:00
1f3e01de0a File name problems 2020-10-12 22:46:54 -04:00
f277bc1684 Changed a few comments 2020-10-12 22:05:26 -04:00
0b53f2cd81 Added comments 2020-10-12 21:43:23 -04:00
b6ae77c7ea Several Changes
Crossover/Mutation:
- Split into individual and population subclasses.
- Added sequential population crossover selection.
- Renamed and reimplemented mutation methods.

EasyGA:
- Improved make_obj methods for the chromosomes and populations to take arguments.

Initialization:
- Improved to shorter code.
- Fixed repeated error messages

Chromosome:
- Changed get/set_genes to get/set_gene_list.
2020-10-12 21:39:17 -04:00
8137bb64d9 Some cleaning up
Added Population.size() and cleaned up the survivor selection.
2020-10-12 16:53:06 -04:00
94d7c52666 Added comments & fixed small bug
Mostly added comments, but also fixed a small bug in parent selection where the tournament size would be much smaller than it should be.
2020-10-12 09:23:41 -04:00
88927f7415 File name changes to match the rest of framework. generation goal was setup twice in EasyGA. 2020-10-08 15:53:35 -04:00
3649293133 Updated GA attribute structure, separated selection file structure
Updated GA attribute structure, separated selection file structure
2020-10-06 22:11:40 -04:00
59f0d03f72 Merge branch 'master' into ryley_beta 2020-10-06 21:11:22 -04:00
665062fdf1 Updated Implementation Framework
Updated to cover changes made by Dan to Master regarding general design changes

Also added remove_two_worst survivor selection method
2020-10-05 20:46:25 -04:00
68db360b94 Alot of name changes and file name changes 2020-10-04 23:56:51 -04:00
e05aa7f62b Changed implementation framework
Instead of a nested approach, selection/crossover/mutation are all called separately and directly by the GA. selection_impl was also separated into parent_selection_impl and survivor_selection_impl, as both are needed separately.
2020-10-04 17:59:59 -04:00
7e587d48d0 Test Implementation for selection/crossover/mutation
The current test implementation includes random mutation, single point crossover, and tournament selection. The implementation, in short, is a nested approach. The selection method is the only thing actually called by the GA. Both crossover and mutation occur within the selection method. As long as these three systems all follow a standard input/output system, any implementation we build, as well as any user implementations, will work perfectly. The selection function must take GA as a parameter and output a new population. Crossover takes in GA and outputs a population. Mutation takes a chromosome set and outputs a new chromosome set.

Many of the changes in this commit are regarding this test implementation. I have also changed many of the file names from "x_examples" to "x_types" and updated the class names to follow capitalziation standards. I did this because I feel personally like the built-in mutation, crossover, and selection implementations are less "examples" and more just already built implementations to make the code required from the user smaller.
2020-10-04 08:00:33 -04:00
aa0c5320c8 Requested file name changes 2020-09-30 23:25:44 -04:00
fbbe017c9b Blank init files 2020-09-28 14:08:49 -04:00
ba62846d4b File structure change, added tests into major folders. 2020-09-22 15:18:37 -04:00
083294ed21 Added file structure 2020-09-21 23:24:07 -04:00