Please enable JavaScript.
Coggle requires JavaScript to display documents.
Reflex and goal-based agents - making decisions - Coggle Diagram
Reflex and goal-based agents - making decisions
Types of agents
Model-based reflex
Goal-based
Simple reflex
Utility-based
Reflex Agents
Simple Reflex
Condition-action rules
Example: Coin-operated turnstile
Model-based Reflex
Model of the world
Example: Traffic light system
Modelling a System
Representation of Knowledge
Useful Technique: FSM (Finite State Machine)
Representation of Knowledge
Useful Technique: FSM (Finite State Machine)
Definition
State depends on old state + input
Examples
Ghosts in a Game
Waiting at home
Chasing (path-finding to target)
Evading (when powered up)
State Transition Table
Rules and Conditions
Condition
State Transition
Current State
Coding FSM
StateType [Patrol, Fight, Flight]
UpdateState Method
FSM Benefits
Relatively simple to code
Easy debugging
Follows hard-coded rules
Intuitive modeling
Flexible behavior
Own history representation
Types of FSM
Deterministic vs. Non-deterministic
Workshop Challenges
Define P.E.A.S. for a useful garden robot
Model the robot with different states
Consider environmental and internal factors
Draw state design pattern UML
Create state transition table
Implement a simple FSM with user-controlled inputs
Embed in Classes
Definition: Incorporating FSM functionality within classes in object-oriented programming.
Purpose: Organize FSM behavior and transitions into modular and reusable components.
Implementation
Each state of the FSM can be represented as a class.
The FSM's transitions and logic are encapsulated within these classes.
Methods within these classes handle state-specific actions and transitions.