concept
Agent and environment
An agent selects actions using available observations; the environment determines transitions. PEAS specifies performance, environment, actuators and sensors. Partial observability and stochastic transitions are independent properties.
Formal Syntax & Structure
artificial-intelligence syntaxartificial-intelligence
state → observation → action → transition → next stateWorking Example
Example Snippetartificial-intelligence
def observe(grid, position, goal): x, y = position right_clear = x + 1 < len(grid[y]) and grid[y][x + 1] == "." return {"right_clear": right_clear, "at_goal": position == goal}
grid = ["...", ".#."]print(observe(grid, (0, 0), (2, 0)))print(observe(grid, (0, 1), (2, 0)))