## 3 Proposed Mechanism
### Quadrant Model for Grid Pattern Generation from the Body Movement  
To track the agent for firing a grid neuron, we have used a reference grid point that keeps tracking the agent coordinate in both x and the y dimension. Initially, while learning an environment, the starting location will be the location of the reference points of all grid neurons. The reference grid point is not having any physical coordinate. Instead, it is just a logical concept that keeps tracking the distance and the direction of the agent until the grid neuron fires. The grid neuron fires only when the agent enters within the vicinity of any other grid point or in any grid ring of the grid neuron. When the grid neuron fires, the reference grid is reset to the new values of the agent tracking parameters. The new values will be calculated with respect to the grid point under whose grid ring the agent is entered.  
Each grid ring's center (i.e., the grid point) has a certain relationship with its surrounding grid rings center due to the periodicity of the firing pattern (calculation is shown in Section 3.2.2). The relationship allows any reference grid point to check whether the agent is entered into the vicinity of any of its surrounding grid point/grid ring or not. The relationship will be in terms of measured distances along both dimensions (i.e., \(x\) and the \(y\)-axis) from the reference grid point. Whenever the agent's measured distances along both dimensions follow the relationship similar to any of the surrounding grid points of the reference grid point, then the grid neuron will be fired. The grid point whose relationship is matched with the agent will be considered as a new reference point. The old tracking parameters will be reset to the new tracking parameters, i.e., the measured distance of the agent from the newly recruited reference point. The same process will be repeated again and again until the agent stops movement.  
Since the reference ring is not always the origin, therefore the agent can move any of the four quadrants of the reference ring. Due to symmetry, the relation of the reference ring with the surrounding grid rings is similar in all four quadrants, as shown in Figure 7. Every grid ring has a corresponding  
Figure 6: Agent’s movement.  
grid ring in all other quadrants, which has the same distances along both dimensions. The signs of the agent's coordinates tell the current quadrant number. The sign of the coordinates will be ignored while matching with the surrounding grid rings as the grid rings follow the same relation in all quadrants.  
2.1 Finding the Coordinates of the Agent Based on the Magnitude and the Current Direction of Movement from a Reference Point  
The calculation of the agent's coordinate with respect to the reference grid point is shown below as Algorithm 1. The parameters used in the algorithm are illustrated in Figure 8. The parameter \"\(\theta\)3\" tells the rotation of the agent's body in degree, \"Direction\" is the direction of movement, that is having two possible values, one is left another is the right, \"\(\theta\)2\" is the quadrant angle before movement and \"\(\theta\)1\" is the quadrant angle after movement.  
\[\theta 1=\left\{\begin{array}{l}\theta 2+\theta 3,\,|\text{Direction }==\text{ LEFT}\\ \theta 2-\theta 3,\,|\text{Otherwise}\end{array}\right. \tag{1}\]  
\[\text{X\_coordinate}=\text{X\_coordinate}+(\text{magnitude }\times\cos\,(\theta 1)) \tag{2}\]  
\[\text{Y\_coordinate}=\text{Y\_coordinate}+(\text{magnitude }\times\sin\,(\theta 1)) \tag{3}\]  
Figure 8: Coordinate calculation.  
Figure 7: Geometry of quadrants.