Description Usage Arguments Details Value Examples
life_cycle
is used to simulate one life cycle of a population.
1 | life_cycle(population, grid_size, n_evidence, steps, sessions)
|
population |
a list containing a population made with |
grid_size |
a numeric vector of the form c(nrow, ncol) which gives the size of the grid. |
n_evidence |
a number specifing the amount of evidence in the grid. |
steps |
a number indicating how many moves the robot should walk in one grid configuration. |
sessions |
a number indicating how many times the grid configuration is changed. |
The fitness of an individual strategy is determined by seeing how well the strategy works in X different sessions.
In one session, the robot walks X steps in a grid and is scored on his actions
(see function move_score
).
A new session is initiated with changing the configuration of the grid. Consequently,
the robot walks again and is scored. The number of sessions is indicated by
the user with the argument sessions
.
This procedure is done for every individual strategy in the population.
The score for each individual strategy in each session.
1 2 3 | first_population <- create_population(50)
life_cycle(population = first_population, grid_size = c(10, 10), n_evidence = 10,
steps = 100, sessions = 200)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.