An AI agent is a system that observes an environment, chooses actions, and pursues a goal. In reinforcement learning, it improves by receiving rewards or penalties for what it does. section 10.1 section 10.5
The idea is most useful when the goal and possible actions are known, but the best sequence of actions is not. Individual choices may matter less than their cumulative effect. section 10.3 section 8.5
An agent typically works through these elements:
- Environment: the changing setting in which the agent operates. section 10.5
- State: the current situation available to the agent. section 10.5
- Actions: the permitted choices the agent can make. section 10.5
- Rewards and penalties: feedback that encourages useful behavior and discourages harmful behavior. section 10.1 section 10.5
Parking-lot navigation
A self-driving car acts as the agent. It can move north, south, east, or west through a parking lot. Empty spaces earn a small positive outcome, reaching its owner earns more, collisions with cars are bad, and collisions with pedestrians are worse. By practicing in a simulator, the agent learns routes that maximize long-term reward rather than merely choosing the best-looking next move. section 10.3 section 10.5
Figure 10.5 The self-driving car in the Parking-Lot Problem
Use the parking-lot diagram to trace the agent, its goal, surrounding obstacles, and the consequences of alternative actions. section 10.3
A simple implementation separates the simulator from the learning algorithm. The simulator resets the environment, reports its state, applies an action, checks boundaries, and calculates the resulting reward. Poorly designed rewards can produce unintended behavior, such as moving repeatedly through empty spaces just to collect points. section 10.5 section 10.5
From games to general behavior
In strategy games, an agent can play repeatedly against different opponents, receive rewards for progress toward winning, and gradually learn tactics that support long-term success. Similar ideas support strategic planning, industrial-process automation, and robotics. section 10.16 section 10.3
































