concept action in category algorithms

This is an excerpt from Manning's book Algorithms and Data Structures in Action.
A more formal definition would describe an ADT as a set of types, a designated type from that type set, a set of functions, and a set of axioms.
Figure 14.10 Building a graph on the map in figure 14.8. We added a vertex to each road intersection (some vertices are however omitted for better readability) and edges connect adjacent intersections connected by a one-way road (two-way roads are modeled with a couple of edges).
![]()

This is an excerpt from Manning's book Grokking Artificial Intelligence Algorithms.
Reinforcement learning is inspired by behavioral psychology. In short, it describes rewarding an individual if a useful action was performed and penalizing that individual if an unfavorable action was performed. To explore a human example, when a child achieves good results on their report card, they are usually rewarded, but poor performance sometimes results in punishment, reinforcing the behavior of achieving good results. Reinforcement learning is useful for exploring how computer programs or robots interact with dynamic environments. An example is a robot that is tasked to open doors; it is penalized when it doesn’t open a door and rewarded when it does. Over time, after many attempts, the robot “learns” the sequence of actions required to open a door.
Figure 10.4 An example of possible actions that have long-term consequences
![]()
Reinforcement learning is most useful for problems in which individual actions build up toward a greater goal. Areas such as strategic planning, industrial-process automation, and robotics are good cases for the use of reinforcement learning. In these areas, individual actions may be suboptimal to gain a favorable outcome. Imagine a strategic game such as chess. Some moves may be poor choices based on the current state of the board, but they help set the board up for a greater strategic win later in the game. Reinforcement learning works well in domains in which chains of events are important for a good solution.
The move_agent function is responsible for moving the agent north, south, east, or west, based on the action. It determines whether the movement is within bounds, adjusts the agent’s coordinates, determines whether a collision occurred, and returns a reward score based on the outcome: