Finite State Machines

Size: px
Start display at page:

Download "Finite State Machines"

Transcription

1 Finite State Machines

2 Finite State Machines (FSMs) An abstract machine that can exist in one of several different and predefined states Defines a set of conditions that determine when the state should change State defines the behaviors to be executed

3 Finite State Machines (FSMs) Long history of involvement in game AI Ghosts in Pac Man are FSMs Ghosts can roam freely, chase player, evade player The transition between these behaviors are determined by the player s actions Even today, FSMs are still very commonly used Easy to understand, implement, debug Lightweight and efficient

4 Basic State Machine Model A generic FSM diagram: S nodes are states, t arrows are transitions Each FSM typically models a set of behaviors for a character or group of characters

5 Basic State Machine Model 4 possible states {Si, S1, S2, S3} Transition functions {t1,t2, t3,t4, t5} Initial state Si, remains in this state until t1 provides a stimulus to switch to S1

6 Pac Man Ghost FSM 3 possible states: Roam, Chase, Evade Transitions include conditions for remaining in a same state

7 Pac Man Ghost FSM

8 Finite State Machine Design Previous sample implementation may not be the most efficient design Efficient design Encourage re-usability Two main components in design 1. Data structures used to store the data associated with the game AI entity 2. Functions for operating transition between states

9 Finite State Machine Design Structures and Classes Typical to store all game AI-related data in a structure or class You can also store the current AI state (for FSM) class AIEntity { public: int type; int state; int row; int column; int health; int strength; int intelligence; int magic; };

10 Finite State Machine Design Use some global constants to define the states (which are in integers) #define kroam 1 #define kevade 2 #define kattack 3 #define khide 4

11 Finite State Machine Design Transition functions Add additional functions that determine how the AI entity should behave class AIEntity { }; public: int type; int state; int row; int column; int health; int strength; int intelligence; int magic; Boolean playerinrange(); int checkhealth();

12 Finite State Machine Design In your main game loop, constant checking should be done to determine when to change states if ((checkhealth()<kpoorhealth) && (playerinrange()==false)) state=khide; else if (checkhealth()<kpoorhealth) state=kevade; else if (playerinrange()) else state=kattack; state=kroam;

13 Finite State Machine Design How would the original FSM diagram looked like for this example behavior? if ((checkhealth()<kpoorhealth) && (playerinrange()==false)) state=khide; else if (checkhealth()<kpoorhealth) state=kevade; else if (playerinrange()) else state=kattack; state=kroam;

14 Example: Ant FSM Description of Ant AI First, the ants will move randomly in their environment in an attempt to locate a piece of food. Once an ant finds a piece of food, it will return to its home position. When it arrives home, it will drop its food and then start a new search for water rather than food. The thirsty ants will roam randomly in search of water. Once an ant finds water, it will resume its search for more food. Returning food to the home position also will result in a new ant emerging from the home position. The ant population will continue to grow so long as more food is returned to the home position. Of course, the ants will encounter obstacles along the way. In addition to the randomly placed food will be randomly placed poison. Naturally, the poison has a fatal effect on the ants. Can you summarize the behavior in an FSM?

15 Example: Ant FSM

16 AI Design-to-Implementation Storyboarding Character Design AI Design (FSM) AI Implementation FSMs can model behaviors very easily, but much more work needs to be done earlier for character design Can we use one generic FSM to model the behavior of a few types of AI characters?

17 Re-using one generic FSM? No, if your AI characters require different set of states and transitions Yes, if they have the same set of states and transitions, but different condition variables E.g. A stronger and matured ant and a junior ant might have the same behaviors (states, transitions) but different requirements for finding food/water, or different resistance levels towards poison.

18 Limitations of a single FSM A single FSM can have limitations in expressing some behaviors. A common source of difficulty is alarm behaviors, or behaviors that require the AI character to do something urgently at any given state, and to resume back the state later Can you think of a scenario where this might happen?

19 Example: Cleaning Robot AI Single FSM operates with no problems However, the robot can run low on power and requires recharging Alarm mechanism: Interrupting the normal behavior to respond to something else important

20 Example: Cleaning Robot AI Adding Get Power state to accommodate the alarm mechanism is not difficult but number of states increase about x2 What if we have a Hide alarm that is another alarm behavior?

21 Example: Cleaning Robot AI So, rather than combining all the logic into a single FSM, we can separate into several FSMs, arranged in a hierarchy Higher levels of hierarchy can respond to alarm behaviors

22 Hierarchical State Machine Higher level: Operates the alarm behavior (to get power) Lower level (within the Clean Up mother state): Operates the cleaning up behavior

23 Hierarchical State Machine H* state: History state that indicates which sub-state (in lower level) should be entered (initially) or resumed (if just returned from the higher level)

24 Hierarchical State Machine It is possible to implement both FSMs separately, but a lot of switching between the two is required implementation inefficiency Nested hierarchy: We are in more than one state at a time (on different levels), just keep track of multiple levels of states

25 Cross Hierarchical Transition If the robot has no objects to collect (of found nothing useful), makes sense to go back to charging bay rather than wasting power Transition from lower level state to a higher level state Lower level FSM is reset, with no history record

26 Weaknesses of FSMs 1. Rigid modeling of behaviors Each character can only have one state at a time straightforward but limited 2. Complex transition conditions can affect efficiency if many conditions need to be checked 3. Behaviors are deterministic Designer pre-determines the actions and behaviors of the character, unlikely for it to respond out side what it was designed to

27 Addressing them 1. Rigid modeling of behaviors Modeling multiple states in a nested hierarchy might help to construct more complex behaviors 2. Complex transition conditions can affect efficiency Use decision trees in the transitions 3. Behaviors are deterministic Apply fuzzy logic to the transitions

Principles of Computer Game Design and Implementation. Lecture 23

Principles of Computer Game Design and Implementation. Lecture 23 Principles of Computer Game Design and Implementation Lecture 23 We already learned Decision Tree 2 Outline for today Finite state machine 3 Creating & Controlling AI Behaviors Behavior: A Sequence of

More information

State-Driven Agent Design

State-Driven Agent Design State-Driven Agent Design Artificial Intelligence for Interactive Media and Games Professor Charles Rich Computer Science Department rich@wpi.edu [Based on Buckland, Chapter 2 and lecture by Robin Burke]

More information

Lotfi Zadeh (professor at UC Berkeley) wrote his original paper on fuzzy set theory. In various occasions, this is what he said

Lotfi Zadeh (professor at UC Berkeley) wrote his original paper on fuzzy set theory. In various occasions, this is what he said FUZZY LOGIC Fuzzy Logic Lotfi Zadeh (professor at UC Berkeley) wrote his original paper on fuzzy set theory. In various occasions, this is what he said Fuzzy logic is a means of presenting problems to

More information

State-Driven Agent Design

State-Driven Agent Design Outline (2 days) State-Driven Agent Design Artificial Intelligence for Interactive Media and Games Professor Charles Rich Computer Science Department rich@wpi.edu [Based on Buckland, Chapter 2 and lecture

More information

Lecture 3 Finite State Machines

Lecture 3 Finite State Machines Lecture 3 Finite State Machines CMPS 146, Fall 2013 Josh McCoy Readings First three will be posted right after class. First lecture: 19-35 Decision Tree lecture: 293-309 FSM/today's lecture: 309-333 All

More information

In examining performance Interested in several things Exact times if computable Bounded times if exact not computable Can be measured

In examining performance Interested in several things Exact times if computable Bounded times if exact not computable Can be measured System Performance Analysis Introduction Performance Means many things to many people Important in any design Critical in real time systems 1 ns can mean the difference between system Doing job expected

More information

MATLAB provides several built-in statements that allow for conditional behavior if/elseif/else switch menu

MATLAB provides several built-in statements that allow for conditional behavior if/elseif/else switch menu Chapter 3 What we have done so far: Scripts/Functions have executed all commands in order, not matter what What we often need: A piece of code that executes a series of commands, if and only if some condition

More information

Engineering program development. Edited by Péter Vass

Engineering program development. Edited by Péter Vass Engineering program development Edited by Péter Vass Introduction Question: Why engineering program development may be useful for a PhD student in Earth Sciences? Counter-argument: In these days a wide

More information

Pacman. you want to see how the maze was created, open the file named unity_pacman_create_maze.

Pacman. you want to see how the maze was created, open the file named unity_pacman_create_maze. Pacman Note: I have started this exercise for you so you do not have to make all of the box colliders. If you want to see how the maze was created, open the file named unity_pacman_create_maze. Adding

More information

Lab 4 Due April 18 th

Lab 4 Due April 18 th Lab 4 Due April 18 th (100 pts) You may work with a partner if you want. Turn in one version with 2 names on it. Do not forget your partner s name. Or work alone. Your choice. Problem 1 (10 pts): Create

More information

6.111 Lecture # 8. Topics for Today: (as time permits)

6.111 Lecture # 8. Topics for Today: (as time permits) 6.111 Lecture # 8 Topics for Today: (as time permits) 1. Memories 2. Assembling 'packages' for designs 3. Discussion of design procedure 4. Development of a design example using a finite state machine

More information

Principles of Computer Game Design and Implementation. Revision Lecture

Principles of Computer Game Design and Implementation. Revision Lecture Principles of Computer Game Design and Implementation Revision Lecture Introduction Brief history; game genres Game structure A series of interesting choices Series of convexities Variable difficulty increase

More information

CS 354R: Computer Game Technology

CS 354R: Computer Game Technology CS 354R: Computer Game Technology AI Fuzzy Logic and Neural Nets Fall 2018 Fuzzy Logic Philosophical approach Decisions based on degree of truth Is not a method for reasoning under uncertainty that s probability

More information

Chapter 4 Defining Classes I

Chapter 4 Defining Classes I Chapter 4 Defining Classes I This chapter introduces the idea that students can create their own classes and therefore their own objects. Introduced is the idea of methods and instance variables as the

More information

Critters. Critter #2 Attack.ROAR Attack.POUNCE Attack.SCRATCH. Critter #1

Critters. Critter #2 Attack.ROAR Attack.POUNCE Attack.SCRATCH. Critter #1 Critters This assignment was co-created by Stuart Reges and Marty Stepp. This program focuses on classes, objects, and inheritance. You will write the following files: Ant.java, Bird.java, Crab.java, FireAnt.java,

More information

Structured Analysis and Structured Design

Structured Analysis and Structured Design Structured Analysis and Structured Design - Introduction to SASD - Structured Analysis - Structured Design Ver. 1.5 Lecturer: JUNBEOM YOO jbyoo@konkuk.ac.kr http://dslab.konkuk.ac.kr References Modern

More information

MODEL BASED TEST DESIGN AT UNITY

MODEL BASED TEST DESIGN AT UNITY Sophia Antipolis, French Riviera 20-22 October 2015 MODEL BASED TEST DESIGN AT UNITY Marek Turski, Ilya Turshatov, Tomasz Paszek Unity Technologies All rights reserved Unity Technologies Provider of an

More information

CS 134 Programming Exercise 9:

CS 134 Programming Exercise 9: CS 134 Programming Exercise 9: Nibbles Objective: To gain experience working with 2 dimensional arrays. The Problem Nibbles is a snake. Nibbles moves around a field, looking for food. Unfortunately, Nibbles

More information

Artificial Intelligence

Artificial Intelligence Artificial Intelligence Lecture 03 Finite State Machines Edirlei Soares de Lima Game AI Model Pathfinding Steering behaviours Finite state machines Automated planning Behaviour

More information

Chapter 12 Object-Oriented Programming. Starting Out with Games & Graphics in C++ Tony Gaddis

Chapter 12 Object-Oriented Programming. Starting Out with Games & Graphics in C++ Tony Gaddis Chapter 12 Object-Oriented Programming Starting Out with Games & Graphics in C++ Tony Gaddis Addison Wesley is an imprint of 2010 Pearson Addison-Wesley. All rights reserved. 12.1 Procedural and Object-Oriented

More information

Programming Exercise

Programming Exercise Programming Exercise Nibbles Objective: To gain experience working with 2 dimensional arrays. The Problem Nibbles is a snake. Nibbles moves around a field, looking for food. Unfortunately, Nibbles is not

More information

LOOPS. Repetition using the while statement

LOOPS. Repetition using the while statement 1 LOOPS Loops are an extremely useful feature in any programming language. They allow you to direct the computer to execute certain statements more than once. In Python, there are two kinds of loops: while

More information

Welcome to SENG 480B / CSC 485A / CSC 586A Self-Adaptive and Self-Managing Systems

Welcome to SENG 480B / CSC 485A / CSC 586A Self-Adaptive and Self-Managing Systems Welcome to SENG 480B / CSC 485A / CSC 586A Self-Adaptive and Self-Managing Systems Dr. Hausi A. Müller and Lorena Castañeda Department of Computer Science University of Victoria http://courses.seng.uvic.ca/courses/2015/summer/seng/480a

More information

SOFTWARE DESIGN COSC 4353 / Dr. Raj Singh

SOFTWARE DESIGN COSC 4353 / Dr. Raj Singh SOFTWARE DESIGN COSC 4353 / 6353 Dr. Raj Singh UML - History 2 The Unified Modeling Language (UML) is a general purpose modeling language designed to provide a standard way to visualize the design of a

More information

VBA Collections A Group of Similar Objects that Share Common Properties, Methods and

VBA Collections A Group of Similar Objects that Share Common Properties, Methods and VBA AND MACROS VBA is a major division of the stand-alone Visual Basic programming language. It is integrated into Microsoft Office applications. It is the macro language of Microsoft Office Suite. Previously

More information

CS 405G: Introduction to Database Systems. Database Design II

CS 405G: Introduction to Database Systems. Database Design II CS 405G: Introduction to Database Systems Database Design II Review From Database Requirement to Relational Model Entity type(set)s Relationship types 2 Next: ER Design Principles Avoid redundancy. Limit

More information

Decisions in Java IF Statements

Decisions in Java IF Statements Boolean Values & Variables In order to make decisions, Java uses the concept of true and false, which are boolean values. Just as is the case with other primitive data types, we can create boolean variables

More information

Building a Complex Application: Customer Tracker. Table of Contents. Description. Design Features Demonstrated in this Application

Building a Complex Application: Customer Tracker. Table of Contents. Description. Design Features Demonstrated in this Application Building a Complex Application: Customer Tracker Built using FEB 8.6 Table of Contents Description...1 Design Features Demonstrated in this Application...1 Application Functionality...1 Basic Structure...1

More information

Object-Oriented Analysis and Design Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology-Kharagpur

Object-Oriented Analysis and Design Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology-Kharagpur Object-Oriented Analysis and Design Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology-Kharagpur Lecture 06 Object-Oriented Analysis and Design Welcome

More information

A Simple Example. The Synchronous Language Esterel. A First Try: An FSM. The Esterel Version. The Esterel Version. The Esterel Version

A Simple Example. The Synchronous Language Esterel. A First Try: An FSM. The Esterel Version. The Esterel Version. The Esterel Version The Synchronous Language Prof. Stephen. Edwards Simple Example The specification: The output O should occur when inputs and have both arrived. The R input should restart this behavior. First Try: n FSM

More information

Operating in a Mixed-language Environment Using HDL, C/C++, SystemC and SystemVerilog

Operating in a Mixed-language Environment Using HDL, C/C++, SystemC and SystemVerilog Application Note Operating in a Mixed-language Environment Using HDL, C/C++, SystemC and SystemVerilog www.model.com Introduction C and C++ languages have an important role to play in ASIC design, and

More information

Chapter 4: Control structures. Repetition

Chapter 4: Control structures. Repetition Chapter 4: Control structures Repetition Loop Statements After reading and studying this Section, student should be able to Implement repetition control in a program using while statements. Implement repetition

More information

Definition: A data structure is a way of organizing data in a computer so that it can be used efficiently.

Definition: A data structure is a way of organizing data in a computer so that it can be used efficiently. The Science of Computing I Lesson 4: Introduction to Data Structures Living with Cyber Pillar: Data Structures The need for data structures The algorithms we design to solve problems rarely do so without

More information

Major Assignment: Pacman Game

Major Assignment: Pacman Game Major Assignment: Pacman Game 300580 Programming Fundamentals Week 10 Assignment The major assignment involves producing a Pacman style game with Clara using the Greenfoot files that are given to you.

More information

Finding and Fixing Bugs

Finding and Fixing Bugs C Finding and Fixing Bugs C.1 Introduction As you will quickly find the BUG is the pain of all programmers existence. This section looks at the most common types of BUGS and some of the strategies for

More information

THE IF STATEMENT. The if statement is used to check a condition: if the condition is true, we run a block

THE IF STATEMENT. The if statement is used to check a condition: if the condition is true, we run a block THE IF STATEMENT The if statement is used to check a condition: if the condition is true, we run a block of statements (called the if-block), elsewe process another block of statements (called the else-block).

More information

SOME TYPES AND USES OF DATA MODELS

SOME TYPES AND USES OF DATA MODELS 3 SOME TYPES AND USES OF DATA MODELS CHAPTER OUTLINE 3.1 Different Types of Data Models 23 3.1.1 Physical Data Model 24 3.1.2 Logical Data Model 24 3.1.3 Conceptual Data Model 25 3.1.4 Canonical Data Model

More information

logical operators and else-if statements

logical operators and else-if statements logical operators and else-if statements Lecture 5 Step 0: TODAY open http://localhost:3000/close -- if this errors that's OK / expected Step 1: Open VSCode and its Integrated Terminal Step 2: npm run

More information

Lecture 2 Finite Automata

Lecture 2 Finite Automata Lecture 2 Finite Automata August 31, 2007 This lecture is intended as a kind of road map to Chapter 1 of the text just the informal examples that I ll present to motivate the ideas. 1 Expressions without

More information

Chapter 4: Control structures

Chapter 4: Control structures Chapter 4: Control structures Repetition Loop Statements After reading and studying this Section, student should be able to Implement repetition control in a program using while statements. Implement repetition

More information

COMP12111 Fundamentals of Computer Engineering Paul Nutter Vasilis Pavlidis Comments

COMP12111 Fundamentals of Computer Engineering Paul Nutter Vasilis Pavlidis Comments Fundamentals of Computer Engineering Paul Nutter Vasilis Pavlidis Comments Please see the attached report. 12 February 2016 Page 2 of 7 Exam Feedback 2015/16 Q1 set by Paul Nutter Q2 set by Vasilis Pavlidis

More information

1 Process Coordination

1 Process Coordination COMP 730 (242) Class Notes Section 5: Process Coordination 1 Process Coordination Process coordination consists of synchronization and mutual exclusion, which were discussed earlier. We will now study

More information

Empath. A Modeling Language for Living Beings. White Paper. Jeremy Posner, Nalini Kartha, Sampada Sonalkar, William Mee

Empath. A Modeling Language for Living Beings. White Paper. Jeremy Posner, Nalini Kartha, Sampada Sonalkar, William Mee Empath A Modeling Language for Living Beings White Paper Jeremy Posner, Nalini Kartha, Sampada Sonalkar, William Mee COMS4115 Programming Languages and Translators 26 September 2006 Introduction The Empath

More information

Elliotte Rusty Harold August From XML to Flat Buffers: Markup in the Twenty-teens

Elliotte Rusty Harold August From XML to Flat Buffers: Markup in the Twenty-teens Elliotte Rusty Harold elharo@ibiblio.org August 2018 From XML to Flat Buffers: Markup in the Twenty-teens Warning! The Contenders XML JSON YAML EXI Protobufs Flat Protobufs XML JSON YAML EXI Protobuf Flat

More information

Mat 2170 Week 9. Spring Mat 2170 Week 9. Objects and Classes. Week 9. Review. Random. Overloading. Craps. Clients. Packages. Randomness.

Mat 2170 Week 9. Spring Mat 2170 Week 9. Objects and Classes. Week 9. Review. Random. Overloading. Craps. Clients. Packages. Randomness. Spring 2014 Student Responsibilities Reading: Textbook, Sections 6.1 6.3 Attendance Recall: Writing Methods Decomposition: break a problem down into smaller subproblems Use methods whenever you can in

More information

Agent Design Example Problems State Spaces. Searching: Intro. CPSC 322 Search 1. Textbook Searching: Intro CPSC 322 Search 1, Slide 1

Agent Design Example Problems State Spaces. Searching: Intro. CPSC 322 Search 1. Textbook Searching: Intro CPSC 322 Search 1, Slide 1 Searching: Intro CPSC 322 Search 1 Textbook 3.0 3.3 Searching: Intro CPSC 322 Search 1, Slide 1 Lecture Overview 1 Agent Design 2 Example Problems 3 State Spaces Searching: Intro CPSC 322 Search 1, Slide

More information

THE OBJECT-ORIENTED DESIGN PROCESS AND DESIGN AXIOMS (CH -9)

THE OBJECT-ORIENTED DESIGN PROCESS AND DESIGN AXIOMS (CH -9) THE OBJECT-ORIENTED DESIGN PROCESS AND DESIGN AXIOMS (CH -9) By: Mr.Prachet Bhuyan Assistant Professor, School of Computer Engineering, KIIT Topics to be Discussed 9.1 INTRODUCTION 9.2 THE O-O DESIGN PROCESS

More information

The Stack, Free Store, and Global Namespace

The Stack, Free Store, and Global Namespace Pointers This tutorial is my attempt at clarifying pointers for anyone still confused about them. Pointers are notoriously hard to grasp, so I thought I'd take a shot at explaining them. The more information

More information

Basics of Java: Expressions & Statements. Nathaniel Osgood CMPT 858 February 15, 2011

Basics of Java: Expressions & Statements. Nathaniel Osgood CMPT 858 February 15, 2011 Basics of Java: Expressions & Statements Nathaniel Osgood CMPT 858 February 15, 2011 Java as a Formal Language Java supports many constructs that serve different functions Class & Interface declarations

More information

The Esterel Language. The Esterel Version. Basic Ideas of Esterel

The Esterel Language. The Esterel Version. Basic Ideas of Esterel The Synchronous Language Esterel OMS W4995-02 Prof. Stephen. Edwards Fall 2002 olumbia University epartment of omputer Science The Esterel Language eveloped by Gérard erry starting 1983 Originally for

More information

Thread Safety. Review. Today o Confinement o Threadsafe datatypes Required reading. Concurrency Wrapper Collections

Thread Safety. Review. Today o Confinement o Threadsafe datatypes Required reading. Concurrency Wrapper Collections Thread Safety Today o Confinement o Threadsafe datatypes Required reading Concurrency Wrapper Collections Optional reading The material in this lecture and the next lecture is inspired by an excellent

More information

Introduction to Scratch

Introduction to Scratch Introduction to Scratch Familiarising yourself with Scratch The Stage Sprites Scripts Area Sequence of Instructions Instructions and Controls If a computer is a box think of a program as a man inside the

More information

Art 486: Introduction to Interactive Media.

Art 486: Introduction to Interactive Media. Art 486: Introduction to Interactive Media mcdo@umbc.edu Schedule Chapter 3! Comments and stuff 3: Puzzles Attributes of Good Puzzle Design Intuitive controls Readily-Identifiable patterns Allows skill

More information

A Game Map Complexity Measure Based on Hamming Distance Yan Li, Pan Su, and Wenliang Li

A Game Map Complexity Measure Based on Hamming Distance Yan Li, Pan Su, and Wenliang Li Physics Procedia 22 (2011) 634 640 2011 International Conference on Physics Science and Technology (ICPST 2011) A Game Map Complexity Measure Based on Hamming Distance Yan Li, Pan Su, and Wenliang Li Collage

More information

Student Responsibilities. Mat 2170 Week 9. Notes About Using Methods. Recall: Writing Methods. Chapter Six: Objects and Classes

Student Responsibilities. Mat 2170 Week 9. Notes About Using Methods. Recall: Writing Methods. Chapter Six: Objects and Classes Student Responsibilities Mat 2170 Week 9 Objects and Classes Spring 2014 Reading: Textbook, Sections 6.1 6.3 Lab 9 Attendance 1 2 Recall: Writing Methods 3 Decomposition: break a problem down into smaller

More information

This paper was presented at DVCon-Europe in November It received the conference Best Paper award based on audience voting.

This paper was presented at DVCon-Europe in November It received the conference Best Paper award based on audience voting. This paper was presented at DVCon-Europe in November 2015. It received the conference Best Paper award based on audience voting. It is a very slightly updated version of a paper that was presented at SNUG

More information

Developing with VMware vcenter Orchestrator. vrealize Orchestrator 5.5.1

Developing with VMware vcenter Orchestrator. vrealize Orchestrator 5.5.1 Developing with VMware vcenter Orchestrator vrealize Orchestrator 5.5.1 You can find the most up-to-date technical documentation on the VMware website at: https://docs.vmware.com/ If you have comments

More information

CSE 142, Autumn 2018 Programming Assignment #9: Critters (20 points) Due Tuesday, December 4th, 9:00 PM

CSE 142, Autumn 2018 Programming Assignment #9: Critters (20 points) Due Tuesday, December 4th, 9:00 PM CSE 142, Autumn 2018 Programming Assignment #9: Critters (20 points) Due Tuesday, December 4th, 9:00 PM This assignment focuses on classes and objects. Turn in Ant.java, Bird.java, Hippo.java, Vulture.java,

More information

CS112 Lecture: Defining Instantiable Classes

CS112 Lecture: Defining Instantiable Classes CS112 Lecture: Defining Instantiable Classes Last revised 2/3/05 Objectives: 1. To describe the process of defining an instantiable class 2. To discuss public and private visibility modifiers. Materials:

More information

Recalibrating the Touch Screen

Recalibrating the Touch Screen Recalibrating the Touch Screen If the Touch Screen is not responding properly, try recalibrating it. The procedure is as follows. * If the Touch Screen is misaligned so much that it is difficult to touch

More information

Input part 3: Implementing Interaction Techniques

Input part 3: Implementing Interaction Techniques Input part 3: Implementing Interaction Techniques Recap: Interaction techniques A method for carrying out a specific interactive task Example: enter a number in a range could use (simulated) slider (simulated)

More information

In-Class Exercises. ETH Zurich. ETH students recently designed a special kind of oven for cooking potatoes. Here are some facts about such an oven:

In-Class Exercises. ETH Zurich. ETH students recently designed a special kind of oven for cooking potatoes. Here are some facts about such an oven: In-Class Exercises ETH Zurich 1 Contracts ETH students recently designed a special kind of oven for cooking potatoes. Here are some facts about such an oven: each oven is equipped with a door which is

More information

Software Service Engineering

Software Service Engineering Software Service Engineering Lecture 4: Unified Modeling Language Doctor Guangyu Gao Some contents and notes selected from Fowler, M. UML Distilled, 3rd edition. Addison-Wesley Unified Modeling Language

More information

CS125 : Introduction to Computer Science. Lecture Notes #38 and #39 Quicksort. c 2005, 2003, 2002, 2000 Jason Zych

CS125 : Introduction to Computer Science. Lecture Notes #38 and #39 Quicksort. c 2005, 2003, 2002, 2000 Jason Zych CS125 : Introduction to Computer Science Lecture Notes #38 and #39 Quicksort c 2005, 2003, 2002, 2000 Jason Zych 1 Lectures 38 and 39 : Quicksort Quicksort is the best sorting algorithm known which is

More information

COMP219: Artificial Intelligence. Lecture 14: Knowledge Representation

COMP219: Artificial Intelligence. Lecture 14: Knowledge Representation COMP219: Artificial Intelligence Lecture 14: Knowledge Representation 1 Overview Last time Game playing Minimax decisions Alpha-beta pruning Today Introduce the need for explicit knowledge representation

More information

CS 378: Computer Game Technology

CS 378: Computer Game Technology CS 378: Computer Game Technology Dynamic Path Planning, Flocking Spring 2012 University of Texas at Austin CS 378 Game Technology Don Fussell Dynamic Path Planning! What happens when the environment changes

More information

CS123. Programming Your Personal Robot. Part 2: Event Driven Behavior

CS123. Programming Your Personal Robot. Part 2: Event Driven Behavior CS123 Programming Your Personal Robot Part 2: Event Driven Behavior You Survived! Smooth Sailing Topics 2.1 Event Driven Programming Programming Paradigms and Paradigm Shift Event Driven Programming Concept

More information

The viewer works in Chrome, Edge, Firefox, and Safari. The web address for the workshop is https://nclab.com/karel-workshop/

The viewer works in Chrome, Edge, Firefox, and Safari. The web address for the workshop is https://nclab.com/karel-workshop/ LOGIC WITH KAREL INTRODUCTION TO CODING AND LOGICAL REASONING Karel is a robot who runs around a 12 x 15 maze, collecting and placing objects. That may sound simple, but Karel teaches all kinds of sophisticated

More information

Reactive and Hybrid Agents. Based on An Introduction to MultiAgent Systems and slides by Michael Wooldridge

Reactive and Hybrid Agents. Based on An Introduction to MultiAgent Systems and slides by Michael Wooldridge Reactive and Hybrid Agents Based on An Introduction to MultiAgent Systems and slides by Michael Wooldridge Reactive Architectures Problems with symbolic/logical approaches (transduction, computational

More information

XNA Network Protocol Specification, Draft 2

XNA Network Protocol Specification, Draft 2 XNA Network Protocol Specification, Draft 2 Brady Dial, Charles McGarvey March 7, 2010 Contents 1 Rationale 2 2 Overview 2 3 The Lobby 3 4 In-Game 5 4.1 Updating Under Good Conditions.................................

More information

ENGR 102 Engineering Lab I - Computation

ENGR 102 Engineering Lab I - Computation ENGR 102 Engineering Lab I - Computation Learning Objectives by Week 1 ENGR 102 Engineering Lab I Computation 2 Credits 2. Introduction to the design and development of computer applications for engineers;

More information

School of Computer Science CPS109 Course Notes 5 Alexander Ferworn Updated Fall 15

School of Computer Science CPS109 Course Notes 5 Alexander Ferworn Updated Fall 15 Table of Contents 1 INTRODUCTION... 1 2 IF... 1 2.1 BOOLEAN EXPRESSIONS... 3 2.2 BLOCKS... 3 2.3 IF-ELSE... 4 2.4 NESTING... 5 3 SWITCH (SOMETIMES KNOWN AS CASE )... 6 3.1 A BIT ABOUT BREAK... 7 4 CONDITIONAL

More information

Comparing and Contrasting different Approaches of Code Generator(Enum,Map-Like,If-else,Graph)

Comparing and Contrasting different Approaches of Code Generator(Enum,Map-Like,If-else,Graph) Comparing and Contrasting different Approaches of Generator(Enum,Map-Like,If-else,Graph) Vivek Tripathi 1 Sandeep kumar Gonnade 2 Mtech Scholar 1 Asst.Professor 2 Department of Computer Science & Engineering,

More information

Computer Programming. Basic Control Flow - Loops. Adapted from C++ for Everyone and Big C++ by Cay Horstmann, John Wiley & Sons

Computer Programming. Basic Control Flow - Loops. Adapted from C++ for Everyone and Big C++ by Cay Horstmann, John Wiley & Sons Computer Programming Basic Control Flow - Loops Adapted from C++ for Everyone and Big C++ by Cay Horstmann, John Wiley & Sons Objectives To learn about the three types of loops: while for do To avoid infinite

More information

EVENTS AND SIGNALS. Figure 1: Events. kinds of events Signal Event

EVENTS AND SIGNALS. Figure 1: Events. kinds of events Signal Event EVENTS AND SIGNALS Events An event is the specification of a significant occurrence that has a location in time and space. Any thing that happens is modeled as an event in UML. In the context of state

More information

Problem Solving through Programming In C Prof. Anupam Basu Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur

Problem Solving through Programming In C Prof. Anupam Basu Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Problem Solving through Programming In C Prof. Anupam Basu Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Lecture 15 Branching : IF ELSE Statement We are looking

More information

DRAWING ENVIRONMENT DIAGRAMS

DRAWING ENVIRONMENT DIAGRAMS DRAWING ENVIRONMENT DIAGRAMS COMPUTER SCIENCE 61A September 10, 2012 0.1 Background A frame is a location where variable bindings are stored A binding is a connection between a name and a value. The name

More information

Programming Game Al by Example

Programming Game Al by Example Programming Game Al by Example Mat Buckland Wordware Publishing, Inc. Contents Foreword Acknowledgments Introduction xiii xvii xix Chapter 7 A Math and Physics Primer 1 Mathematics 1 Cartesian Coordinates

More information

CS4411 Intro. to Operating Systems Exam 1 Fall points 10 pages

CS4411 Intro. to Operating Systems Exam 1 Fall points 10 pages CS4411 Intro. to Operating Systems Exam 1 Fall 2005 (October 6, 2005) 1 CS4411 Intro. to Operating Systems Exam 1 Fall 2005 150 points 10 pages Name: Most of the following questions only require very short

More information

(Refer Slide Time: 1:27)

(Refer Slide Time: 1:27) Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi Lecture 1 Introduction to Data Structures and Algorithms Welcome to data

More information

n Specifying what each method does q Specify it in a comment before method's header n Precondition q Caller obligation n Postcondition

n Specifying what each method does q Specify it in a comment before method's header n Precondition q Caller obligation n Postcondition Programming as a contract Assertions, pre/postconditions and invariants Assertions: Section 4.2 in Savitch (p. 239) Loop invariants: Section 4.5 in Rosen Specifying what each method does q Specify it in

More information

Lab 6 Debugging. Objective. Introduction. Prelab

Lab 6 Debugging. Objective. Introduction. Prelab UNIVERSITY OF CALIFORNIA AT BERKELEY COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE Lab 6 Debugging Objective You will explore several techniques for debugging a digital

More information

AN INTRODUCTION TO SCRATCH (2) PROGRAMMING

AN INTRODUCTION TO SCRATCH (2) PROGRAMMING AN INTRODUCTION TO SCRATCH (2) PROGRAMMING Document Version 2 (04/10/2014) INTRODUCTION SCRATCH is a visual programming environment and language. It was launched by the MIT Media Lab in 2007 in an effort

More information

Chapter Goals. Contents LOOPS

Chapter Goals. Contents LOOPS CHAPTER 4 LOOPS Slides by Donald W. Smith TechNeTrain.com Final Draft Oct 30, 2011 Chapter Goals To implement while, for, and do loops To hand-trace the execution of a program To become familiar with common

More information

Program Modeling Concepts:

Program Modeling Concepts: Program Modeling Concepts: Lesson-6: FSM STATE TABLE AND ITS APPLICATIONS 1 FSM State Table A state table can then be designed for representation of every state in its rows. The following six columns are

More information

General Syntax. Operators. Variables. Arithmetic. Comparison. Assignment. Boolean. Types. Syntax int i; float j = 1.35; int k = (int) j;

General Syntax. Operators. Variables. Arithmetic. Comparison. Assignment. Boolean. Types. Syntax int i; float j = 1.35; int k = (int) j; General Syntax Statements are the basic building block of any C program. They can assign a value to a variable, or make a comparison, or make a function call. They must be terminated by a semicolon. Every

More information

Critter #1 Attack.ROAR random winner #2 wins #1 wins Attack.POUNCE #1 wins random winner #2 wins Attack.SCRATCH #2 wins #1 wins random winner

Critter #1 Attack.ROAR random winner #2 wins #1 wins Attack.POUNCE #1 wins random winner #2 wins Attack.SCRATCH #2 wins #1 wins random winner CSE 142, Winter 2016 Programming Assignment #8: Critters (40 points) Due: Tuesday, March 8, 2016, 11:30 PM (Husky must be submitted on time to be in tournament in class on Friday, March 11) This assignment

More information

D - Tic Tac Toe. Let's use our 9 sparkles to build a tic tac toe game! 2017 courses.techcamp.org.uk/ Page 1 of 9

D - Tic Tac Toe. Let's use our 9 sparkles to build a tic tac toe game! 2017 courses.techcamp.org.uk/ Page 1 of 9 D - Tic Tac Toe Let's use our 9 sparkles to build a tic tac toe game! 2017 courses.techcamp.org.uk/ Page 1 of 9 INTRODUCTION Let's use our 9 sparkles to build a tic tac toe game! Step 1 Assemble the Robot

More information

2D Arrays. Lecture 25

2D Arrays. Lecture 25 2D Arrays Lecture 25 Apply to be a COMP110 UTA Applications are open at http://comp110.com/become-a-uta/ Due December 6 th at 11:59pm LDOC Hiring committee is made of 8 elected UTAs 2D Arrays 0 1 2 Easy

More information

Today (1) N64 Controller (Project Checkpoint#1) Today (2) Administrative Info (1)

Today (1) N64 Controller (Project Checkpoint#1) Today (2) Administrative Info (1) Today (1) N64 Controller (Project Checkpoint#1) EECS150 Spring2006 Lab Lecture #6 Philip Godoy Guang Yang Greg Gibeling Administrative Info Lab #4 Solution Lab #5 Tips Project Overview Design Review Requirements

More information

SQL Maestro and the ELT Paradigm Shift

SQL Maestro and the ELT Paradigm Shift SQL Maestro and the ELT Paradigm Shift Abstract ELT extract, load, and transform is replacing ETL (extract, transform, load) as the usual method of populating data warehouses. Modern data warehouse appliances

More information

Specification of Model Behavior

Specification of Model Behavior Specification of Model Behavior Lecture Topics Behavioral Model Relation to Other Behavioral Models Derivation of for Single Classes Derivation of from System Level 1 Behavioral Models 1. Software system

More information

COMP 110 Programming Exercise: Simulation of the Game of Craps

COMP 110 Programming Exercise: Simulation of the Game of Craps COMP 110 Programming Exercise: Simulation of the Game of Craps Craps is a game of chance played by rolling two dice for a series of rolls and placing bets on the outcomes. The background on probability,

More information

MASTERS THESIS SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF MASTER OF MECHANICAL ENGINEERING

MASTERS THESIS SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF MASTER OF MECHANICAL ENGINEERING MASTERS THESIS SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF MASTER OF MECHANICAL ENGINEERING TITLE: Auto-Generation and Real-Time Optimization of Control Software for Multi-Robot

More information

Digital Design and Computer Architecture J. Spjut & M. Spencer

Digital Design and Computer Architecture J. Spjut & M. Spencer Digital Design and Computer Architecture J. Spjut & M. Spencer Lab 3: Adventure Game Introduction In this lab may you will design a Finite State Machine (FSM) that implements an adventure game! You will

More information

The Bizarre Truth! Automating the Automation. Complicated & Confusing taxonomy of Model Based Testing approach A CONFORMIQ WHITEPAPER

The Bizarre Truth! Automating the Automation. Complicated & Confusing taxonomy of Model Based Testing approach A CONFORMIQ WHITEPAPER The Bizarre Truth! Complicated & Confusing taxonomy of Model Based Testing approach A CONFORMIQ WHITEPAPER By Kimmo Nupponen 1 TABLE OF CONTENTS 1. The context Introduction 2. The approach Know the difference

More information

Graph and the World of Brains

Graph and the World of Brains Graph and the World of Brains Edwin Lunando/13509024 Program Studi Teknik Informatika Sekolah Teknik Elektro dan Informatika Institut Teknologi Bandung, Jl. Ganesha 10 Bandung 40132, Indonesia edwinlunando@gmail.com

More information

(Refer Slide Time: 1:40)

(Refer Slide Time: 1:40) Computer Architecture Prof. Anshul Kumar Department of Computer Science and Engineering, Indian Institute of Technology, Delhi Lecture - 3 Instruction Set Architecture - 1 Today I will start discussion

More information

Pac Man Game Programming Language. Reference Manual. Chun Kang Chen (cc3260) Hui Hsiang Kuo (hk2604) Shuwei Cao (sc3331) Wenxin Zhu (wz2203)

Pac Man Game Programming Language. Reference Manual. Chun Kang Chen (cc3260) Hui Hsiang Kuo (hk2604) Shuwei Cao (sc3331) Wenxin Zhu (wz2203) Pa aml Pac Man Game Programming Language Reference Manual Chun Kang Chen (cc3260) Hui Hsiang Kuo (hk2604) Shuwei Cao (sc3331) Wenxin Zhu (wz2203) 1 Table of Contents 1. Introduction... 4 2. Lexical conventions...

More information

SFWR ENG 3S03: Software Testing

SFWR ENG 3S03: Software Testing (Slide 1 of 52) Dr. Ridha Khedri Department of Computing and Software, McMaster University Canada L8S 4L7, Hamilton, Ontario Acknowledgments: Material based on [?] Techniques (Slide 2 of 52) 1 2 3 4 Empirical

More information