C# Class social_learning.World

Afficher le fichier Open project: tansey/social-learning Class Usage Examples

Méthodes publiques

Méthode Description
Reset ( ) : void

Resets the world by calling reset on each agents and plant, then generating a new layout for the plants.

Step ( ) : void

Moves all agents in the world forward by one step and collects food for any agents on top of a plant.

World ( IEnumerable agents, int height, int width, IEnumerable species, IEnumerable predators, PlantLayoutStrategies layout = PlantLayoutStrategies.Uniform, int agentHorizon = DEFAULT_AGENT_HORIZON ) : System
calculateForagingAgentSensors ( IAgent agent ) : double[]
calculatePredatorSensors ( Predator predator ) : double[]

Private Methods

Méthode Description
applyToroidalAgentLocationRules ( IAgent agent ) : void

Forces the agent to stay on screen by wrapping them around the other side of the world if they run over an edge.

clusteredLayout ( ) : void
getSensorIndex ( IAgent agent, int offset, int pos ) : int
layoutPlants ( ) : void
onAgentEaten ( Predator eater, IAgent agent ) : void
onChanged ( EventArgs e ) : void
onPlantEaten ( IAgent eater, Plant plant ) : void
onStepped ( EventArgs e ) : void
spiralLayout ( ) : void
uniformLayout ( ) : void

Method Details

Reset() public méthode

Resets the world by calling reset on each agents and plant, then generating a new layout for the plants.
public Reset ( ) : void
Résultat void

Step() public méthode

Moves all agents in the world forward by one step and collects food for any agents on top of a plant.
public Step ( ) : void
Résultat void

World() public méthode

public World ( IEnumerable agents, int height, int width, IEnumerable species, IEnumerable predators, PlantLayoutStrategies layout = PlantLayoutStrategies.Uniform, int agentHorizon = DEFAULT_AGENT_HORIZON ) : System
agents IEnumerable
height int
width int
species IEnumerable
predators IEnumerable
layout PlantLayoutStrategies
agentHorizon int
Résultat System

calculateForagingAgentSensors() public méthode

public calculateForagingAgentSensors ( IAgent agent ) : double[]
agent IAgent
Résultat double[]

calculatePredatorSensors() public méthode

public calculatePredatorSensors ( Predator predator ) : double[]
predator Predator
Résultat double[]