mgo.tools.execution
Type members
Classlikes
Example: Let type C[A] = (SomeState,A)
Example: Let type C[A] = (SomeState,A)
// Initialisation val (initialState, initialGs) = unwrap(initialGenomes) val initialPop = initialGs.map(express)
// First step: val (s11, genomes1) = run((initialState,initialPop), breeding) val indivs1 = genomes1.map(express) val (s12, selected1) = run((s11,indivs1), elitism)
// Second step: val (s21, genomes2) = run((s12, selected1), breeding) val indivs2 = genomes2.map(express) val (s22, selected2) = run((s21, indivs2), elitism)
An datastructure describing an computation which at some points delegates some work to the user. The user receives an intermediate state (type SI) and a value of type X by calling pre. The value needs to be transformed into another of type Y that is fed back to the computation, along with the intermediate state with the functions post. e.g. pseudo-code to run the whole computation:
An datastructure describing an computation which at some points delegates some work to the user. The user receives an intermediate state (type SI) and a value of type X by calling pre. The value needs to be transformed into another of type Y that is fed back to the computation, along with the intermediate state with the functions post. e.g. pseudo-code to run the whole computation:
(si, x) = pre() y = f(x) result = post(si, y)
- Value Params
- append
The monoid binary operator to combine 2 states
- empty
The monoid identity element, such that: append(empty, s) == s, append(s, empty) == s
- split
Split the current state. The second member of the tuple is to be sent as input to the next step. The first is to become the new current state. This function can compute new states or simply duplicate its input, untouched, e.g. split(s) == (s, s).