move_score: Move the Robot and Score his Actions

Description Usage Arguments Details Value Examples

Description

move_score is used to move the robot through the grid according to his strategy table and to score his actions.

Usage

1
move_score(individual, grid, latitude, longitude, steps)

Arguments

individual

one individual strategy taken form the population made with create_poulation.

grid

an object of class matrix made with create_grid.

latitude

a number indicating the current position of the robot on the y-axis.

longitude

a number indicating the current position of the robot on the x-axis.

steps

a number indicating how many moves the robot should walk in the grid.

Details

The robot begins at his starting position (latitude = 2, longitude = 2). The robot then follows one strategy for X actions. The number of actions is indicated by the user with the argument steps. If there is no wall in the direction of his next movement, the robot walks. If his next action is to stay, the robot stops moving.

The score of the strategy is the number of bonus- and minuspoints the robot accumulates in a session. If the robot is in the same site as a piece of evidence and picks it up, he gets ten points. If he bends down to pick up in a site where there is no evidence, he is fined one point. If he crashes into a wall, he is fined five points and bounces back into the current site.

Value

The robots position after taking all steps and the resulting score.

Examples

1
2
3
population <- create_population(100)
grid <- create_grid(c(10, 12), 11)
move_score(population[[1]], grid = grid, latitude = 5, longitude = 5, steps = 100)

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