Please enable JavaScript.
Coggle requires JavaScript to display documents.
Reflex & Goal-Based Agents - Decision Making - Coggle Diagram
Reflex & Goal-Based Agents - Decision Making
Agent Types Recap
Simple reflex
Model-based reflex
Goal-based
Utility-based
Modeling Systems
Representation of knowledge.
Decision-making mechanisms for agents.
Finite State Machines (FSMs): Useful for handling different states.
Finite State Machines (FSMs)
Concept:
State depends on the previous state and current input.
Models behavior based on discrete states and transitions.
Components:
States: Define agent's behavior and potential actions.
Transitions: Movement between states.
Rules/Conditions: Determine when transitions occur.
Input Events: Triggers for state transitions.
Characteristics:
Only one state active at a time.
Deterministic (predictable) or non-deterministic (unpredictable).
Can be event-driven (multiple inputs, weighted outcomes, randomization).
Examples
Basic logic controllers (programs, microcontrollers, circuits).
USB communication protocols.
Game AI (Pac-Man ghosts: waiting, chasing, evading).
Implementation
Code Representation:
Use enums or constants to represent states.
Employ a switch statement or lookup table to execute actions based on the current state.
State Design Pattern:
Each state is a class.
Methods within classes handle transitions.
Example: Miner Bob (from "Programming Game AI by Example")
Advantages of FSMs
Simple to code and debug.
Relatively low processing power required (less intelligence).
Intuitive modeling.
Flexible for tweaking behavior.
Can represent agent's history (to some extent).
Workshop Challenges
Challenge 1: Design a garden robot with an FSM.
Define P.E.A.S.
Model states, inputs (environmental, internal), and transitions.
Create a state transition table.
Challenge 2: Implement a basic FSM.
Use text strings to represent states and output to the console.
Allow user input to simulate changing conditions.
Additional Resources
Articles and tutorials on FSMs, state design patterns, and examples in different programming languages.