Getting Started¶
Welcome to custom_grid_env! This page will help you get familiar with the environment quickly.
Concepts¶
The environment simulates a grid where an agent must navigate. The following components play a central role:
- AgentInterface: The primary interface for your AI agents. It encapsulates the environment, the ghost, and the particle filter.
- Particle Filter: A mechanism for estimating the agent's position if it is not exactly known (localization).
- CNN Classification: A neural network that processes images of grid cells to recognize objects like dogs or flowers.
First Experiments¶
A Simple Example¶
Here is a minimal script to start an agent with random movements:
from custom_grid_env.interface import AgentInterface
from custom_grid_env.agents.random_player_agent import RandomPlayerAgent
# Initialize interface
interface = AgentInterface(render=True)
obs = interface.reset()
# Create agent
agent = RandomPlayerAgent(interface.get_action_space())
# Run episode
for _ in range(100):
action = agent.get_action(obs)
obs, reward, done, info = interface.step(action)
if done:
break
interface.close()
Further Tutorials¶
Check out our detailed tutorials: - CNN Training Tutorial - Particle Filter Tutorial