Decision Making: Decision Tree & State Machines Session 07

Slides:



Advertisements
Similar presentations
Artificial Intelligence 12. Two Layer ANNs
Advertisements

Heuristic Search techniques
UML State chart/machine diagram State machine diagram is a behavior diagram which shows discrete behavior of a part of designed system through finite state.
The Assembly Language Level
Lecture Set 3E Introduction Basic Software Development Issues 1. Notes on Software Development 2. Intro to Software Development Tools 7/31/2008 2:43PM.
Michael Zyda Finite State Machines Michael Zyda
Artificial Intelligence in Game Design Intelligent Decision Making and Decision Trees.
© Copyright 2011 John Wiley & Sons, Inc.
SE-565 Software System Requirements More UML Diagrams.
Lecture 4 Finite State Machine CS6133 Software Specification and Verification.
Game AI Fundamentals. What is Artificial Intelligence (AI)? Not easy to answer… “Ability of a computer or other machine to perform those activities that.
Artificial Intelligence in Game Design Behavior Trees.
Artificial Intelligence in Game Design
 2000 Deitel & Associates, Inc. All rights reserved. Optional Case Study - Chapter 3 Outline 3.1 Introduction 3.2 Class Attributes 3.3 Statechart Diagrams.
CS 415 – A.I. Slide Set 5. Chapter 3 Structures and Strategies for State Space Search – Predicate Calculus: provides a means of describing objects and.
SOFTWARE DESIGN. INTRODUCTION There are 3 distinct types of activities in design 1.External design 2.Architectural design 3.Detailed design Architectural.
UML Discussion on State Machines Perfectly static system is intensely uninteresting Because nothing ever happens.
Chapter 11 Activity Diagrams. 2 “Activity diagrams are a technique to describe procedural logic, business processes, and work flows” - M. Fowler An activity.
Basic Game AI IMGD 4000 With material from: Ian Millington and John Funge. Artificial Intelligence for Games, Morgan Kaufmann, (Chapter 5)
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 26. Review UML behavioral Diagrams – Sequence diagram.
Dr Nick Mitchell (Room CM 224)
Finite State Machines (FSM) OR Finite State Automation (FSA) - are models of the behaviors of a system or a complex object, with a limited number of defined.
Convolutional Coding In telecommunication, a convolutional code is a type of error- correcting code in which m-bit information symbol to be encoded is.
A Brief History of AI Fall 2013 COMP3710 Artificial Intelligence Computing Science Thompson Rivers University.
WHAT ARE PLANS FOR? Philip E. Agre David Chapman October 1989 CS 790X ROBOTICS Presentation by Tamer Uz.
Finite State Machines Logical and Artificial Intelligence in Games Lecture 3a.
Goal-Oriented Game AI Purpose and Utilizations Research Organized by: Evan Schipellite.
Team Member AI in an FPS and Goal Oriented Action Planning.
Introduction to Machine Learning, its potential usage in network area,
Business Process and Functional Modeling
CHAPTER NINE.
UML Chapter 17.
ACTIVITY DIAGRAMS 《UML面向对象建模基础》.
Computer Organization and Architecture + Networks
UML Diagrams By Daniel Damaris Novarianto S..
State Machine Diagram.
State Machine Diagrams
Fundamentals of Information Systems, Sixth Edition
Finite State Machines Dr K R Bond 2009
Course Outcomes of Object Oriented Modeling Design (17630,C604)
Presentation of Flowchart
Unified Modeling Language
System Design and Modeling
Graph Coverage for Specifications CS 4501 / 6501 Software Testing
Enemy and Friendly AIs Richard Gesick.
Decision Trees & Rule-based AI
Auburn University COMP 2710 Software Construction Use Case Analysis and Exercises (Part 2) Dr. Xiao Qin Auburn University.
Programming Fundamentals
Artificial Intelligence in Game Design
ECE 448 Lecture 6 Finite State Machines State Diagrams vs. Algorithmic State Machine (ASM) Charts.
UML dynamic Modeling (Behavior Diagram)
UNIT-4 BLACKBOX AND WHITEBOX TESTING
UML Activity Diagrams & State Charts
Central Processing Unit
Chapter 9 Structuring System Requirements: Logic Modeling
Theory of Computation Turing Machines.
CIS 488/588 Bruce R. Maxim UM-Dearborn
BPMN - Business Process Modeling Notations
EA C461 – Artificial Intelligence Problem Solving Agents
Graph Coverage for Specifications CS 4501 / 6501 Software Testing
Introduction to Artificial Intelligence Lecture 15: Expert Systems
Artificial Intelligence 12. Two Layer ANNs
Chapter 9 Structuring System Requirements: Logic Modeling
COMP3710 Artificial Intelligence Thompson Rivers University
EGR 2131 Unit 12 Synchronous Sequential Circuits
Artificial Intelligence
Chapter 4 System Modeling.
Introduction to information retrieval
Fast-Track UiPath Developer Module 3: Workflow Organization
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Presentation transcript:

Decision Making: Decision Tree & State Machines Session 07 Course : COMP6228 – Artificial Intelligence Effective Period : February 2017 Decision Making: Decision Tree & State Machines Session 07

Introduction Ask a gamer about gameAI, and they think about decision making: the ability of a character to decide what to do External knowledge is the information that a character knows about the game environment around it: the position of other characters, the direction that a noise is coming from, and so on. Internal knowledge is information about the character’s internal state or thought processes: its health, its ultimate goals,what it was doing a couple of seconds ago,and so on.

Overview of Decision Making Decision making schematic Actions, correspondingly, can have two components: they can request an action that will change the external state of the character(such as throwing as witch, firing a weapon, moving into a room)or actions that only affect the internal state. They might correspond to changing the character’s opinion of the player,changing its emotional state, or changing its ultimate goal The AI model

Decision Trees Decision trees are fast, easily implemented, and simple to understand. They are the simplest decision making technique that we’ll look at, although extensions to the basic algorithm can make them quite sophisticated. They are used extensively to control characters and for other in-game decision making, such as animation control.

The decision tree with a decision made Decision Trees The path taken by the algorithm is highlighted, showing the arrival at a single action, which may then be executed by the character. The decision tree with a decision made

Decision Trees Combinations of Decisions The decision tree is efficient because the decisions are typically very simple. Each decision makes only one test. When Boolean combinations of tests are required, the tree structure represents this. Trees representing AND and OR

Wide decision tree with decision Decision Trees Branching The decision tree is efficient because the decisions are typically very simple. Each decision makes only one test. When Boolean combinations of tests are required, the tree structure represents this. Wide decision tree with decision

Deep binary decision tree Decision Trees Branching Imagine having a guard character in a military facility. The guard needs to make a decision based on the current alert status of the base. This alert status might be one of a set of states: “green,” “yellow,” “red,” or “black,” for example. Deep binary decision tree

Flat decision tree with four branches Decision Trees Branching We could allow our decision tree to have several branches at each decision point. With four branches, the same decision tree now looks like Figure below. Flat decision tree with four branches

Random Decision Trees Often, we don’t want the choice of behavior to be completely predictable. Some element of random behavior choice adds unpredictability, interest, and variation. It is simple to add a decision into the decision tree that has a random element. We could generate a random number, for example, and choose a branch based on its value. Because decision trees are intended to run frequently, reacting to the immediate state of the world, random decisions cause problems. Random tree

State Machines State machines are the technique most often used for this kind of decision making and, along with scripting, make up the vast majority of decision making systems used in current games. A simple state machine States are connected together by transitions. Each transition leads from one state to another, the target state, and each has a set of associated conditions.

State Machines Finite State Machines In game AI any state machine with this kind of structure is usually called a finite state machine (FSM). This and the following sections will cover a range of increasingly powerful state machine implementations, all of which are often referred to as FSMs. The Game FSM The basic state machine structure is very general and admits any number of implementations. We have seen tens of different ways to implement a game FSM, and it is rare to find any two developers using exactly the same technique. That makes it difficult to put forward a single algorithm as being the “state machine” algorithm.

Hard-Coded FSM A few years back, almost all state machines were hard coded. The rules for transitions and the execution of actions were part of the game code. It has become less common as level designers get more control over building the state machine logic, but it is still an important approach.

Hierarchical State Machines On its own, one state machine is a powerful tool, but it can be difficult to express some behaviors. One common source of difficulty is “alarm behaviors.” Rather than combining all the logic into a single state machine,we can separate it into several. Each alarm mechanism has its own state machine, along with the original behavior. The basic cleaning robot state machine

Hierarchical State Machines An alarm mechanism in a standard state machine

Hierarchical State Machines A hierarchical state machine for the robot We will nest one state machine inside another to indicate a hierarchical state machine

Hierarchical State Machines A hierarchical state machine with a cross-hierarchy transition For example,let’s expand our robot so that it can do something useful if there are no objects to collect. It makes sense that it will use the opportunity to go and recharge,rather than standing around waiting for its battery to go flat.

Combining Decision Trees and State Machines The implementation of transitions bears more than a passing resemblance to the implementation of decision trees. This is no coincidence, but we can take it even further. Decision trees are an efficient way of matching a series of conditions, and this has application in state machines for matching transitions. We can combine the two approaches by replacing transitions from a state with a decision tree. The leaves of the tree, rather than being actions as before, are transitions to new states.

Hierarchical State Machines The diamond symbol is also part of the UML state chart diagram format, representing a decision. In UML there is no differentiation between decisions and transitions, and the decisions themselves are usually not labelled. State machine with decision tree transitions

Hierarchical State Machines To implement the same state machine without the decision nodes, the state machine in Figure below would be required. State machine without decision tree transitions

Exersise Please explain http://www.yaldex.com/games-programming/0672323699_ch12lev1sec6.html

References Ian Millington. 2009. Artificial intelligence for games. Morgan Kaufmann Publishers. Burlington. ISBN:9780123747310 Stuart Russell. (2010). Artificial intelligence : a modern approach. 03. Pearson Education. New Jersey. ISBN: 9780132071482.