base_evo_game: Simulate a two dimensional plane with agents and food over...

View source: R/base_evo_game.R

base_evo_gameR Documentation

Simulate a two dimensional plane with agents and food over time

Description

The function base_evo_game runs agents through circles of status changes and movements that resemble a simplified evolution process on a 2 dimensional plane. The agents have the possibility to eat food when being on a coordinate with food.

Usage

base_evo_game(
  rowsField = 20,
  columnsField = 20,
  nFood = 50,
  nAgent = 20,
  tick = 20,
  foodGeneratingType = "linear",
  foodGeneratingFactor = 1
)

Arguments

rowsField

Numeric value > 1 that determines the number of rows the game takes place in.

columnsField

Numeric value > 1 that determines the number of columns the game takes place in.

nFood

Numeric value that determines the number of food palets that are present at the start of the game.

nAgent

Numeric value that determines the number of agents that are present at the start of the game.

tick

Numeric value that determines the number of time points that the game runs at most.

foodGeneratingType

String value "linear" or "cumulative", which determines if food is added per time point as constant or based on the amount of food that is already present.

foodGeneratingFactor

Numeric value that determines how many food is added, depending on foodGeneratingType.

Details

For information each data frame column and information about the underlying generating process, see the github README.md file.

Value

A list of two data frames with information about individual agents ("Agent_Details") and food quantities ("Food_Details") at each time point. Each agent individual has a personal identification ("ID"), each field with food a quantity ("n"). Both data frames contain information about the row ("row"), column ("col"), and index ("ind") where the agent/food is located at that time.

See Also

base_game_function

Examples

game <- base_evo_game(rowsField = 4, columnsField = 4, nFood = 2, nAgent = 3, tick = 5, foodGeneratingType = "linear", foodGeneratingFactor = 1)
game$Agent_Details
game$Food_Details

PhilNrbts/EvoGame documentation built on Sept. 14, 2024, 1:25 a.m.