Description Usage Details Fitness functions Response emission functions Get the operant class Stock reinforcement schedule Mutation Fitness weights See Also
A list of functions in the CAB
package's implementation of McDowell's Evolutionary Behaviour Dynamics. A list of lower level utility functions, such as for converting integers in base 10 to base 2 can be found in EBD_utilities. See CAB.EBD for more details.
1 2 3 4 5 6 7 8 9 10 11 12 | EBD_WSI_fitness(max_phenotype, phenotypes, last_resp)
EBD.response_emission(preallocated_resp_index, tick, phenotypes)
EBD.get_oc(last_resp, oc_lower_bounds)
EBD.geometric_vi(inter_rft_interval, min_irt, time)
EBD.w_gaussian_mutation(tick, preallocated_mutant_change,
preallocated_mutant_index, max_phenotype, phenotypes)
EBD.geometric_fitness_weights(fitness, parental_selection_p)
|
Stuff.
Computes the fitness of parents.
EBD.wrapped_si_fitness
Wrapped specific individual fitness. The fitness value of a behaviour is max( |i-k|, m - |i-k| ), where i is the base 10 value of a behaviour in the population, k is the integer value of the reinforced behaviour, and m is the maximum base 10 value that a behaviour can take. It is wrapped because it is modularised around the domain [0,m].
EBD.wrapped_si_fitness( domain, phenotypes, last_resp )
domain
A vector specifying the minimum and maximum base 10 values that a behaviour can take.
phenotypes
A numeric vector of behaviours in base 10.
Returns a numeric vector of the same length as phenotyes
. Indices will match.
############################################################################
Emits a response.
EBD.response_emission
Emits a behaviour.
EBD.response_emission( preallocated_resp_index, n_rft, time, rft_ticks, phenotypes )
preallocated_resp_index
A numeric value.
n_rft
Number of reinforcement that occurred during a session.
time
Number of time ticks.
rft_ticks
Duration of reinforcment delivery.
phenotypes
A numeric vector of behaviours in base 10
.
The way that EBD is implemented in CAB
is that the index of the responses are preallocated at the start of the simulation. This reduces the number of function calls to a random number generator and hence improves the speed of the model. The response index is recovered from the number of time ticks that the simulation has been run, time
, accounting for the time ticks that were taken up by reinforcement deliveries.
Returns a value selected from phenotyes
.
############################################################################
From a behaviour in base 10, get the operant class.
EBD.get_oc
Get the operant class
EBD.get_oc( last_resp, oc_lower_bounds )
last_resp
A numeric value.
oc_lower_bounds
Lower bounds of the operant classes.
Returns the operant class that the last response belongs in.
############################################################################
Common reinforcement schedules.
EBD.geometric_vi
A VI schedule with geometrically distributed arranged inter-reinforcement intervals.
EBD.geometric_vi( inter_rft_interval, min_irt, time )
inter_rft_interval
Numeric. In real time.
min_irt
Minimum inter-response time, i.e. time ticks for the algorithm.
time
Numeric
Generates a Geometrically distributed inter-reinforcement interval by doing a continuous to discrete transformation of the inter-rft-interval and adds the time to return the time at which food will be available.
EBD.shifted_geometric_vi
A VI schedule with shifted geometrically distributed arranged inter-reinforcement intervals.
EBD.geometric_vi( inter_rft_interval, min_irt, time, shift )
inter_rft_interval
Numeric. In real time.
min_irt
Minimum inter-response time, i.e. time ticks for the algorithm.
time
Numeric.
shift
Numeric. In real time.
Generates a Geometrically distributed inter-reinforcement interval by doing a continuous to discrete transformation of the inter-rft-interval and adds the time to return the time at which food will be available.
############################################################################
Mutate behaviours in the population.
EBD.w_gaussian_mutation
Mutate behaviours my resampling their phenotypes from a wrapped normal distribution.
EBD.w_gaussian_mutation( tick, preallocated_mutant_change, preallocated_mutant_index, max_phenotype, phenotypes )
tick
Numeric. The number of iterations of the algorithm.
preallocated_mutant_change
Matrix giving how much each phenotype changes.
preallocated_mutant_index
Matrix giving the phenotypes that will change.
max_phenotype
Numeric. The maximum phenotype value.
phenotypes
Vector.
preallocated_mutant_change
is a matrix that has rows the number of iterations to run the algorithm. Each column is the amount to change each phenotype to be mutated on that iteration.
preallocated_mutant_index
is a matrix of corresponding dimensions. Each column is the index of the phenotype to change.
Returns a list containing the new phenotype values and the indices to which they belong.
############################################################################
Sampling weights for sampling fitness values.
EBD.geometric_fitness_weights
Sampling weights from a geometric distribution
EBD.geometric_fitness_weights( fitness, parental_selection_p )
fitness
Numeric vector of fitness values
parental_selection_p
Parameter for the geometric distribution
Returns a vector of fitness weights.
############################################################################
CAB.EBD
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.