Commit Graph

76 Commits

Author SHA1 Message Date
Kamil Śliwak
98fcba8ef3 [yul-phaser] Phaser: Reimplement << and >> operators using serializeChoice() and deserializeChoice() 2020-03-13 11:21:23 +01:00
Kamil Śliwak
deaf1d0c6f [yul-phaser] Add serializeChoice() and deserializeChoice() 2020-03-13 11:21:23 +01:00
Kamil Śliwak
0c3de9ef99 [yul-phaser] Add Common module 2020-03-13 11:21:23 +01:00
Kamil Śliwak
a80512a71d [yul-phaser] Phaser: Name option parameters in command-line help 2020-03-13 11:21:23 +01:00
Kamil Śliwak
df90cf5d7a [yul-phaser] Phaser: Make all option descriptions consistenly end with a full stop 2020-03-13 11:21:23 +01:00
Kamil Śliwak
ffc21632b6 [yul-phaser] Phaser: Split command-line option description into groups 2020-03-13 11:21:23 +01:00
Kamil Śliwak
7cf5c4e266 [yul-phaser] Phaser: Extract preparation of option description into a separate function 2020-03-13 11:21:23 +01:00
Kamil Śliwak
2d177c7623 [yul-phaser] Phaser: Refactor object creation in runAlgorithm() into a set of factories 2020-03-13 11:21:23 +01:00
Kamil Śliwak
25e81f6bd3 [yul-phaser] AlgorithmRunner: Count rounds from 1 2020-03-13 11:21:23 +01:00
Kamil Śliwak
2110bf10cf [yul-phaser] AlgorithmRunner: Create a structure to store runner's options 2020-03-13 11:21:23 +01:00
Kamil Śliwak
b8244f6a43 [yul-phaser] Extract the code that controls execution of algorithm rounds from GeneticAlgorithm into AlgorithmRunner 2020-03-13 11:21:23 +01:00
Kamil Śliwak
0c1b88508e [yul-phaser] Refactor the code from main into a Phaser class 2020-03-13 11:21:23 +01:00
Kamil Śliwak
3e3887dc9a [yul-phaser] main: Add missing underscores to parameter names 2020-03-13 11:21:23 +01:00
Kamil Śliwak
0fa2aa62b2 [yul-phaser] main: Lower gene mutation chance in GEWEP 2020-03-09 13:21:48 +01:00
Kamil Śliwak
763bdb1d51 [yul-phaser] Change the design of crossover operators so that they produce a single chromosome rather than a pair 2020-03-09 13:21:48 +01:00
cameel
a3e97108c5 [yul-phaser] main: Add GenerationalElitistWithExclusivePools as an option and make it the default 2020-03-09 13:21:48 +01:00
Kamil Śliwak
0c61f6d18f [yul-phaser] main: Command-line option for algorithm selection 2020-03-09 13:21:48 +01:00
Kamil Śliwak
fc4fedb214 [yul-phaser] Add GenerationalElitistWithExclusivePools algorithm 2020-03-09 13:21:48 +01:00
cameel
7e80ac861f [yul-phaser] Population: Add mutate() and crossover() methods 2020-03-09 13:21:48 +01:00
Kamil Śliwak
c941eaf5d6 [yul-phaser] Add randomPointCrossover() and fixedPointCrossover() operators 2020-03-09 13:21:48 +01:00
cameel
3fdb4ca607 [yul-phaser] Add geneRandomisation(), geneDeletion(), geneAddition and alternativeMutations() 2020-03-09 13:21:48 +01:00
Kamil Śliwak
f9f2bdb5f7 [yul-phaser] Add RandomPairSelection and PairMosaicSelection classes 2020-03-09 13:21:48 +01:00
cameel
44932dc85a [yul-phaser] Base class for pair selections 2020-03-09 13:21:48 +01:00
Kamil Śliwak
7c7ebbb35f [yul-phaser] main: Rename initializeRNG() to initialiseRNG() 2020-03-09 13:21:48 +01:00
Kamil Śliwak
66d733fbac [yul-phaser] main: Increase the number of chromosomes in the initial population to 20 2020-02-25 16:06:16 +01:00
Kamil Śliwak
3aaca31c31 [yul-phaser] main: Change the number of chromosomes preserved in every round of the algorithm to 1 2020-02-25 16:06:16 +01:00
Kamil Śliwak
4aac7d1673 [yul-phaser] main: Switch from using Population::run() to RandomAlgorithm 2020-02-25 16:06:16 +01:00
Kamil Śliwak
e1b8b64f05 [yul-phaser] Population: Remove no longer used methods for running algorithm steps
- They have been superseded by objects from GeneticAlgorithms.h
2020-02-25 16:06:16 +01:00
cameel
67fbafab8f [yul-phaser] Add RandomAlgorithm 2020-02-25 16:06:16 +01:00
cameel
4665b7a7e4 [yul-phaser] Population: Add select() method 2020-02-25 15:25:16 +01:00
cameel
83b8ab8012 [yul-phaser] Add RangeSelection, MosaicSelection and RandomSelection classes 2020-02-25 15:25:16 +01:00
cameel
3c41bfbc4e [yul-phaser] Base class for selections 2020-02-25 15:25:16 +01:00
cameel
11bdf358df [yul-phaser] Base class for genetic algorithms 2020-02-25 15:25:16 +01:00
Kamil Śliwak
e8192e9aa3 [yul-phaser] main: Set the number of optimisation sequence repetitions to 5 2020-02-19 17:26:34 +01:00
cameel
2291cf78ac [yul-phaser] Population: Add constructors to Individual to simplify initialization 2020-02-19 17:26:34 +01:00
cameel
cef01c961a [yul-phaser] Population: Keep the individuals always sorted 2020-02-19 17:26:34 +01:00
cameel
76842ac3fd [yul-phaser] Population: Evaluate fitness immediately when an individual is added or modified
- This removes the explicit evaluation phase.
- Fitness is no longer optional in Individual
2020-02-19 17:26:34 +01:00
cameel
66fdc1c374 [yul-phaser] Population: Store fitness metric rather than program directly
- In the console app use ProgramSize metric when creating the population.
2020-02-19 17:03:35 +01:00
cameel
85074e7a8a [yul-phaser] Population: Extract sorting from doSelection() into sortIndividuals() in Population class 2020-02-19 17:03:35 +01:00
cameel
41f36f421d [yul-phaser] Population: Extract conversion from chromosomes to individuals into a separate function 2020-02-19 17:03:35 +01:00
Kamil Śliwak
930a9918a6 [yul-phaser] ProgramSize: Add an option to repeat the optimisation sequence several times 2020-02-19 16:36:14 +01:00
cameel
2238919c76 [yul-phaser] Add ProgramSize metric 2020-02-19 16:36:14 +01:00
cameel
096129fbc4 [yul-phaser] Base class for fitness metrics 2020-02-19 16:36:14 +01:00
Kamil Śliwak
31d8d5930a [yul-phaser] Population: Equality operators for populations and individuals 2020-02-18 19:40:37 +01:00
cameel
d9c5e2dc9f [yul-phaser] Population: Add operator+() 2020-02-18 19:40:37 +01:00
Kamil Śliwak
ecb30c670f [yul-phaser] Population: Make ordering of individuals with same fitness deterministic and prioritise shorter chromosomes
- Before this change the order of chromosomes with the same fitness in a population depended on the initial order set when the population was first created. Now it only depends on the individual.
- The length comparison is not strictly necessary (lexicographical order covers that) but it makes the intention clear and the comparison slightly faster when chromosomes have different lengths.
2020-02-18 19:40:37 +01:00
Kamil Śliwak
40a6669538 [yul-phaser] Population: Extract a function for comparing fitness of individuals
- Mostly for readability and convenience. This significantly shortens calls to sort().
- I could define it as Individual::operator< instead but it would be inconsistent with operator== because it does not compare the chromosomes, only fitness. It could result in an unintuitive situation where (a <= b <= a) does not necessarily imply (a == b).
2020-02-18 19:40:37 +01:00
Kamil Śliwak
806891f494 [yul-phaser] Population: Customizable chromosome length in makeRandom() 2020-02-18 19:40:37 +01:00
Kamil Śliwak
d22c59aa0e [yul-phaser] Chromosome: Add a constructor that reads steps from an abbreviation string 2020-02-18 19:38:55 +01:00
cameel
71dcbf9df5 [yul-phaser] Population: Remove ambiguous default from one of the constructors 2020-02-18 19:38:55 +01:00