-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathTODO
More file actions
141 lines (120 loc) · 6.12 KB
/
Copy pathTODO
File metadata and controls
141 lines (120 loc) · 6.12 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
MAJOR PROJECTS
- Setup the concept of genomes throughout MABE with a comprehensive interface.
- Setup Organisms to be built from arbitrary brains and geneomes.
- Setup Web interface (for both graphical config and doing runs)
- Update config files in many ways, but especially:
* Handling array types.
* Allowing for mathematical expressions to be calculated at run-time based
on current values.
* Come up with a clean way to distinguish whether identifiers are config
variables, organism traits, and population traits.
* Printing longer (multi-line) comments.
- Setup organisms that need to be processed and ideally even processed
asynchronusly and interactively.
- FIX evaluation system. Instead of being limited to an evaluation phase,
evaluator modules should be able to indicate on a trait that if it is needed
to call them. Ideally with a caching option as well... For computationally
intensive evaluations, this will allow them to only be called when needed.
== NEW VERSION OF MABEScript ==
Key ideas:
- All modules are written in MABEScript
- MABEScript can either be compiled to C++ (for compute speed) or interpreted (for ease)
- Modules will have a main function associated with them.
For example, and instance the EliteSelect module 'elite_select' will can be called as
elite_select(main_pop, 10) and would return the 10 selected individuals.
- Member function calls are interchangeable with stand-alone function with type as first argument.
- Populations are basically fancy OrgLists
Organisms can be in only one Population and always know which one they are in.
Master list of organisms keeps orgs at a unique position. IndexSet track which orgs are in a set.
Organisms will ALSO have a unique ID so no two orgs can ever be confused.
== Signals ==
Signals will be easy to name and to provide relevant information.
By default signals will only trigger modules listening to a particular population.
Signals are triggered with the "trigger" keyword. For example:
trigger "BeforeDeath" (position=target_org.GetPosition());
Modules specify what trigger names they are paying attention to.
on "BeforeDeath" { ... actions that can use "position" as an input variable ... }
== Labels ==
Each module / function / config parameter works with labels in "name: value" format.
desc: is used for the description.
type: specified the type name something resolves to.
default: gives a default value.
min_value: sets a lower limit, below which an out-of-range error should occur.
max_value: sets an upper limit, above which an out-of-range error should occur.
min_adjust: a soft lower limit that will adjust automatically without error.
max_adjust: a soft upper limit that will adjust automatically without error.
Any other labels are allowed. They are const Datum type (strings or values that can't be changed)
== Types ==
Built in types should include:
- Int (must be a numeric integer value) (Do we need more specifics for compilation to C++?)
- UInt
- Float
- Char
- Bool
- String
- BitSet
- TraitEquation:
automatically assumes all traits used are "required"
if treated as a function, converts to the resulting value
requires all traits are convertible to Float (unless a more restrictive "convert_to:" is set)
- TraitSet:
automatically assumes all traits used are "required"
if "convert_to:" is specified, limits the traits allowed
.Insert(...) add the organism or organisms provided to this set.
.Remove(...) remove the organism or organisms provided from this set.
- Organism
- Population: A natural grouping of organisms.
.ID() every population has a unique ID for unambiguous identification
.Size()
.IsEmpty() true/false is population empty?
.IsEmpty(pos) is population position empty?
.At(position) return the organism at the specified position
.Has(Organism) - true/false, is organism in here?
.Has(OrgSet / OrgList) - true/false, are ALL organisms in here?
.HasOverlap(OrgSet / OrgList) - does this population have any organisms in common with the entry provided?
.Insert(Organism / OrgSet) - Insert provided organism(s) into this population.
.Remove(Organism / OrgSet) - Remove provided organism(s) from this population.
.FindMax(trait_fun, count=1)
.FindMin(trait_fun, count=1)
.Weights(trait_fun) use function to place orgs in a WeightedSet (OrgWeights) object
.Alive() return an OrgSet of the living orgs in the population
.ToOrgList()
.ToOrgSet()
.TraitValues(String trait_name)
return a vector of trait values corresponding to population position
.TraitValues(TraitSet trait_set)
return a 2D matrix of trait values; row = trait ID, col = population position
.SelectSet(count) build a random OrgSet of the desired size (no replacement)
.SelectList(count) build a random OrgList of the desired size (with replacement)
.GenerateOutput()
.DoBirth(Organism, Parent)
.DoInject(Organism)
.GetNeighbor(Organism)
- OrgSet: A set of organisms (by position); no duplicates or ordering
Same member functions as Population.
- OrgList: A list of organisms in order, potentially with repeats
Same member functions as Population.
.Resize(new_size) - New orgs are empty of new size > old size
- OrgWeights: A map of organisms to weight levels
.SelectSet(count) - select count orgs with proper weights (no duplications)
.SelectList(count) - select count independent organisms from container with weights
== Keywords ==
`if`
`foreach`
`function` - about to define a new function.
`in` - with `foreach`, specifies container. with `if`, tests inclusion
`mutable` - vars are const unless preceded by this keyword
`return`
`while`
`config`
`module`
`trait`
== Built-in functions ==
Random(...) - Generate a random value.
no args: Float in range 0.0 to 1.0
one arg: Must be numerical type; output same type, from 0 to value
two args (min / max): Must be numerical type; output common type, from min to max
Range(...)
one arg: generate Int[] or UInt[] (depending on arg) from 0 to target value (exclusive)
two args: generate array from min to max in steps of 1 (or 1.0) in common type
three args: Generate array using min,step,max in common type