-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTODO
41 lines (31 loc) · 1.3 KB
/
TODO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
1. Provide a Storable instance for AI.MEP.Types.Gene
and make the Chromosome a Data.Vector.Storable.
2. Improve code generation:
Perform subexpression elimination,
e.g. x0 / x0 should be reduced to 1
1 + 1 should become 2, etc.
And possibly, support unary operators:
Interpreted expression
v1 = x0 / x0
v3 = s x0 v1
v6 = v3 / v1
v14 = s x0 v6
v15 = v14 * v6
result = v1 - v15
should eventually become
v1 = sin x0
v2 = v1 * v1
result = 1 - v2
3! Redefine functions `F` to have arbitrary arity instead of 2:
(e.g. `type F a = (BS, Vector a -> a)`).
Use a bytestring BS instead of Char to represent a function
OR represent functions with an abstract type + evaluate table
(potentially slower).
4. Performance tuning and benchmarking using Criterion package.
Hint: use of matrices featuring O(1) memory access
instead of lists of vectors ([Chromosome a], [Phenotype a]),
might improve the speed of such operators as binaryTournament.
5! Implement subpopulations that eventually exchange individuals
6. The following declaration of `newGene` (type class `Genetic`)
might be preferable
newGene :: (PrimMonad m) => Int -> RandT m (Gene a Int)