Commit Graph

75 Commits

Author SHA1 Message Date
Kamil Śliwak
259f738f17 [yul-phaser] ProgramBasedMetric: Add the ability to use ProgramCache 2020-03-24 17:39:24 +01:00
Kamil Śliwak
8b443627e2 [yul-phaser] Add ProgramCache class 2020-03-24 17:39:24 +01:00
chriseth
f89e154693
Merge pull request #8514 from imapp-pl/yul-phaser-prefix-option
[yul-phaser] --prefix option
2020-03-24 17:35:45 +01:00
Kamil Śliwak
a66ceb11c6 [yul-phaser] Add --prefix option 2020-03-23 16:31:35 +01:00
Kamil Śliwak
29186f9951 [yul-phaser] Program: Switch from using parseCode() to parseObject() 2020-03-23 16:31:19 +01:00
Kamil Śliwak
d86652cb96 [yul-phaser] Add --metric-aggregator option 2020-03-18 16:28:16 +01:00
Kamil Śliwak
bc46323bed [yul-phaser] Phaser: Accepting multiple input programs
- Use average of metric values for individual programs as the overall metric.
2020-03-18 16:28:16 +01:00
Kamil Śliwak
01050940fd [yul-phaser] Add --relative-metric-scale option 2020-03-18 16:28:16 +01:00
Kamil Śliwak
8e64c5c6f0 [yul-phaser] Add --metric option 2020-03-18 16:28:16 +01:00
Kamil Śliwak
e4a360947b [yul-phaser] Add FitnessMetricCombination and derived classes for average, sum, min and max 2020-03-18 16:28:16 +01:00
Kamil Śliwak
0e03839e62 [yul-phaser] Add RelativeProgramSize metric 2020-03-18 16:28:15 +01:00
Kamil Śliwak
7edbbe4edd [yul-phaser] Make FitnessMetric::evaluate() non-const 2020-03-18 16:28:15 +01:00
Kamil Śliwak
0913fd1aac [yul-phaser] Extract ProgramBasedMetric base class from ProgramSize 2020-03-18 16:28:15 +01:00
Kamil Śliwak
bdc4d1ccd1 [yul-phaser] ProgramSize metric: Refactor repeating parts of test code
- Also replace test fixture constructor with direct member initialisation
2020-03-18 16:28:15 +01:00
Kamil Śliwak
a2821db1dd [yul-phaser] Phaser: Tests for factories 2020-03-18 13:30:58 +01:00
Kamil Śliwak
18f0d6eb94 [yul-phaser] AlgorithmRunner: Duplicate chromosome randomisation 2020-03-18 13:30:58 +01:00
Kamil Śliwak
1b5960111d [yul-phaser] AlgorithmRunner: Population autosave 2020-03-18 13:30:58 +01:00
Kamil Śliwak
ff99d25bc3 [yul-phaser] Common: Add readLinesFromFile() 2020-03-18 13:30:58 +01:00
Kamil Śliwak
5e814acc3c [yul-phaser] TestHelpers: Add TemporaryDirectory class 2020-03-18 13:30:58 +01:00
Kamil Śliwak
8ca0d90aae [yul-phaser] Returning an ErrorList from Program::load() if program has errors and printing them in Phaser 2020-03-16 20:32:59 +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
099299c5e7 [yul-phaser] Rename Common to Helpers in tests (update references) 2020-03-13 11:21:23 +01:00
Kamil Śliwak
d01dab7b7c [yul-phaser] Rename Common to Helpers in tests (file move)
- I want to add Common.h in the non-test code and it's getting confusing. I think it's better to have them named differently.
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
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
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
92b54d83a3 [yul-phaser] Common: Add geneSubstitution() mutation 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
643a5f2035 [yul-phaser] Common: Add wholeChromosomeReplacement() mutation and countDifferences() 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
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
11bdf358df [yul-phaser] Base class for genetic algorithms 2020-02-25 15:25:16 +01:00
Kamil Śliwak
26bae6b459 [yul-phaser] Common: Add countSubstringOccurrences() 2020-02-25 15:25:16 +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
Kamil Śliwak
930a9918a6 [yul-phaser] ProgramSize: Add an option to repeat the optimisation sequence several times 2020-02-19 16:36:14 +01:00
Kamil Śliwak
751caf0ed3 [yul-phaser] Common: Add ChromosomeLengthMetric 2020-02-19 16:36:14 +01:00
cameel
2238919c76 [yul-phaser] Add ProgramSize metric 2020-02-19 16:36:14 +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