social_learning.World.applyToroidalAgentLocationRules C# (CSharp) 메소드

applyToroidalAgentLocationRules() 개인적인 메소드

Forces the agent to stay on screen by wrapping them around the other side of the world if they run over an edge.
private applyToroidalAgentLocationRules ( IAgent agent ) : void
agent IAgent
리턴 void
        private void applyToroidalAgentLocationRules(IAgent agent)
        {
            if (agent.X >= Width)
                agent.X -= Width;
            if (agent.Y > Height)
                agent.Y -= Height;
            if (agent.X < 0)
                agent.X += Width;
            if (agent.Y < 0)
                agent.Y += Height;
        }