social_learning.World.Reset C# (CSharp) Method

Reset() public method

Resets the world by calling reset on each agents and plant, then generating a new layout for the plants.
public Reset ( ) : void
return void
        public void Reset()
        {
            foreach (var agent in Agents)
            {
                agent.X = Width / 2;
                agent.Y = Height / 2;
                agent.Orientation = 0;
                agent.Fitness = 0;
            }

            layoutPlants();

            _step = 0;

            // Notify any listeners that the world stateActionPair has changed
            onChanged(EventArgs.Empty);
        }

Usage Example

Example #1
0
 /// <summary>
 /// Reset the internal stateActionPair of the evaluation scheme if any exists.
 /// </summary>
 public void Reset()
 {
     _world.Reset();
 }