life_cycle: One Life Cycle of a Population

Description Usage Arguments Details Value Examples

Description

life_cycle is used to simulate one life cycle of a population.

Usage

1
life_cycle(population, grid_size, n_evidence, steps, sessions)

Arguments

population

a list containing a population made with create_population.

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.

Details

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.

Value

The score for each individual strategy in each session.

Examples

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)

Tabea123/FindMyCat documentation built on June 5, 2019, 7:56 a.m.