COMP9414 Arti cial Intelligence 
	GridWorldEnv Environment User Guide 
	Term 2, 2025
	Version: 1.0
	Last Updated: July 2025
	Purpose: This guide provides comprehensive documentation for the  GridWorldEnv class used in Assignment 2
	1    Overview 
	The GridWorldEnv class implements a grid world environment for reinforcement learn- ing experiments. This guide covers installation, usage, and troubleshooting for the envi- ronment provided in env .py.
	2    Environment Speci cations 
	The environment implements an 11 × 11 grid world with the following characteristics:
	{ Grid Size: 11 × 11 cells
	{ State Space: Discrete 2D coordinates (x;y) where x;y ∈ {0;1;:::;10}
	{ Action Space: 4 discrete actions
	{ Goal Position: (10; 10) - bottom-right corner
	{ Starting Position: Random (avoiding obstacles and goal)
	{ Episode Termination: Only when goal is reached
	2.1    Coordinate System 
	The environment uses a standard 2D coordinate system:
	o Origin (0; 0) is at the top-left corner
	o X-axis increases downward (rows)
	o Y-axis increases rightward (columns)
	2.2    Obstacles 
	The environment contains 10   xed obstacles arranged in two patterns:
	L-shaped pattern (top-left area):
	o Positions:  (2; 2), (2; 3), (2; 4), (3; 2), (4; 2) 
	Cross pattern (centre): 
	o Positions:  (5; 4),  (5; 5), (5; 6), (4; 5), (6; 5)
	2.3    Action Space
	
		
			
				| 
						Action 
					 | 
						Value 
					 | 
						E ect 
					 | 
			
				| 
						Up 
					 | 
						0 
					 | 
						Decrease x by 1 
					 | 
			
				| 
						Down 
					 | 
						1 
					 | 
						Increase x by 1 
					 | 
			
				| 
						Left 
					 | 
						2 
					 | 
						Decrease y by 1 
					 | 
			
				| 
						Right 
					 | 
						3 
					 | 
						Increase y by 1 
					 | 
		
	
	2.4    Reward Structure 
	
		
			| 
					Event 
				 | 
					Reward 
				 | 
		
			| 
					Reach Goal 
				 
					Hit Obstacle 
				 
					Normal Step 
				 | 
					+25 
				 
					-10 
				 
					-1 
				 |