social_learning.SensorDictionary.SensorDictionary C# (CSharp) Method

SensorDictionary() public method

public SensorDictionary ( int agentHorizon, int height, int width ) : System
agentHorizon int
height int
width int
return System
        public SensorDictionary(int agentHorizon, int height, int width)
        {
            _dictionary = new Dictionary<int, int[]>();
            _agentHorizon = agentHorizon;
            _height = height;
            _width = width;
            _defaultDistanceAndOrientation = new int[] { _agentHorizon + 10, -1 };
            for (int i = -1 * agentHorizon; i < agentHorizon; i++)
                for (int j = -1 * agentHorizon; j < agentHorizon; j++)
                    for (int k = -1; k < 2; k++)
                        for (int l = -1; l < 2; l++)
                        {
                            int[] p = calculateDistanceAndOrientation(i, j);
                            _dictionary[(i + k * height) % height * agentHorizon * 100 + ((j + l * width) % width)] = p;
                        }
        }