MICROMOUSE ALGORITHMS. Navigation, Path finding, and Maze Encoding

Size: px
Start display at page:

Download "MICROMOUSE ALGORITHMS. Navigation, Path finding, and Maze Encoding"

Transcription

1 MICROMOUSE ALGORITHMS Navigation, Path finding, and Maze Encoding

2 FEEDBACK CONTROL Your mouse can never go perfectly straight in practice Mouse can drift to one side, traction may not be same on wheels, etc. Need feedback control to remain centered in the cell Periodically use IR sensor data (and perhaps gyro) to determine error Slightly speed up a motor and slow another to correct heading

3 PID FEEDBACK CONTROL

4 PROPORTIONAL FEEDBACK Difference between where you are and where you want to be The larger the error, the larger the correction to be applied (intuitive) Scaled by the K p constant current_error: return curpos - cellmidpoint P_controller: error = current_error() return Kp * error

5 INTEGRAL FEEDBACK The sum of all your previous errors in time Attempts to prevent errors before they occur, based on how they occurred in past E.g. mouse tends to lean right, it should tend to drive left to even out Scaled by K I constant error_integral = 0 I_controller: error = current_error() error_integral += (error * delay_time) // May need to reset to 0 sometimes return Ki * error_integral

6 DERIVATIVE FEEDBACK The change in error since the last sample Prevents overshooting target based on how the error is changing by predicting when we will hit the desired position Scaled by K D constant previous_error = 0 D_controller: error = current_error() derivative = (error - previous_error) / delay_time previous_error = error return Kd * derivative

7 COMBINING PID TOGETHER error_integral = 0 previous_error = 0 last_sample = 0 pid: curtime = time() delay_time = curtime - last_sample last_sample = curtime error = curpos - cellmidpoint error_integral += (error * delay_time) error_derivative = (error - previous_error) / delay_time previous_error = error correction = (Kp * error) + (Ki * error_integral) + (Kd * error_derivative) return correction

8 PID TUNING The PID constants are very important and determine the accuracy of your system Easy system is essentially unique, and can behave differently in different environments Strategy: 1. Set all gains to zero. 2. Increase the P gain until the response to a disturbance is steady oscillation. 3. Increase the D gain until the the oscillations go away (i.e. it's critically damped). 4. Repeat steps 2 and 3 until increasing the D gain does not stop the oscillations. 5. Set P and D to the last stable values. 6. Increase the I gain until it brings you to the setpoint with the number of oscillations desired (normally zero but a quicker response can be had if you don't mind a couple oscillations of overshoot)

9 PATH FINDING Plethora of path finding algorithms exist Floodfill is one of the most common implementations Tries to find the shortest path Not necessarily fastest path Easy to implement Run-time variable Initialize goal to 0, all other cells to their Manhattan distance from the goal Move to neighbor with lowest distance Image water flowing down towards goal (sink) which we follow

10

11 FLOODFILL PSEUDOCODE Slightly different than typical implementation: has modifications I found to be useful/effective floodfill: let stack = stack of points to be processed // can also use queue, same results push current mouse position on stack while stack not empty: let cur = pop top element of stack mark cur as processed if dist(cur) == 0 skip to next // don't want to update end goal with a non-zero distance! let shortest = +infinity // signify "not set"/invalid path for all directions (N, S, E, W) let neighbor = cur + direction if no wall between cur and neighbor if dist(neighbor) < shortest then set shortest = dist(neighbor) if neighbor not processed before then push neighbor on stack if shortest == +infinity then skip to next // cell has no openings, continue if cur dist == shortest + 1 then skip to next // nothing was updated set dist(cur) = shortest + 1 push all OPEN neighbors of cur on the stack, even if previously processed // can cause problems if you don t

12 QUICK DEMO

13 FLOODFILL SIMULATOR You can find a decent Micromouse simulator at Download the.jar file and run it on your computer On Linux/OS X: run `java jar /path/to/maze-solver.jar` Helps in making sure your floodfill implementation is correct

14 ENCODING THE MAZE Maze is a 16x16 grid: 256 cells Goal is 4 cells in the center Various walls and no walls between the cells We need a data structure that we can use quickly and efficiently Any ideas?

15 ENCODING THE MAZE Naïve approach: store NSEW wall or no wall for each cell Kind of redundant: if you can go North from cell A to cell B, then you can go South from cell B as well Better approach: store one array of wall positions Look up cell openings using a position and direction e.g. if at cell (0,0) can we go North (to (0,1))? Look if there is a wall above cell (0,0)

16 ENCODING THE MAZE Since we are using boolean values, we can compress data even further, using a bit per value instead of a whole byte Use a bitvector for the walls in the maze! Interface for bitvector data structure: Set a bit (set to 1) Clear a bit (set to 0) Get a bit We can use an array of bit integers (use the uint16_t type) Row indexes in the array, column indexes the bit of the uint16_t Note: to keep indexing values sane, it might be better to use one bitvector for horizontal walls and one for vertical walls, so that we can disambiguate them.

17 BITWISE MATH REVIEW OR ( ) NEGATE (~) AND ( & ) Left shift << << <<

18 BITWISE MATH REVIEW & & ~( ) &

19 BITWISE MATH RECAP Set a bit by ORing variable with a number where only that bit is set Clear a bit by ANDing variable with a number where all bits BUT bit in question is set Get a bit by ANDing a variable with a number where only that bit is set, and check if the result == 0 We can position a 1 anywhere we want by LEFT-SHIFTing by that amount We can position a 0 anywhere by positioning a 1 in its place and then NEGATING that value

20 !!!! BITVECTOR IMPLEMENTATION #include <stdint.h> // uint16_t! #include <cstring> // memset! public:! void set(unsigned x, unsigned y) {! // WARNING: Code has no initialization/ bounds checking! // Don't use it directly or it will probably crash!!!! class BitVector256 {! protected:! const unsigned VECTOR_SIZE = 16;! uint16_t vector[vector_size];! }! vector[x] = 1<<y;! }! void clear(unsigned x, unsigned y) {! vector[x] &= ~(1<<y);! }! bool get(unsigned x, unsigned y) {! return (vector[x] & 1<<y)!= 0;! }!

21 CHECKIN CODE

PID Controller application in robotics. Victor Abreu A /5/2013. Executive Summary:

PID Controller application in robotics. Victor Abreu A /5/2013. Executive Summary: PID Controller application in robotics Victor Abreu A42379353 4/5/2013 Executive Summary: The proportional integral derivative controller is a generic control loop feedback mechanism that is widely used

More information

Program your face off

Program your face off Program your face off Game plan Basics of Programming Primitive types, loops, and conditionals. What is an Object oriented language? Tips and tricks of WPIlib Iterative and Command Based robots Feedback

More information

Data Types primitive, arrays, objects Java overview Primitive data types in Java

Data Types primitive, arrays, objects Java overview Primitive data types in Java Data Types primitive, arrays, objects Java overview Primitive data types in Java 46 Recap Day 2! Lessons Learned:! Sample run vs. pseudocode! Java program structure: set-up, then real statements, decent

More information

MANUAL FOR RECTILINEAR AND TORSIONAL POSITION CONTROL SYSTEM Prof. R.A. de Callafon, Dept. of MAE, UCSD, version

MANUAL FOR RECTILINEAR AND TORSIONAL POSITION CONTROL SYSTEM Prof. R.A. de Callafon, Dept. of MAE, UCSD, version MANUAL FOR RECTILINEAR AND TORSIONAL POSITION CONTROL SYSTEM Prof. R.A. de Callafon, Dept. of MAE, UCSD, version 3.1415 ECP HARDWARE & SOFTWARE Turning on Hardware Turn on the ECP (model 205 or 210) control

More information

If you note any errors, typos, etc. with this manual or our software libraries, let us know at

If you note any errors, typos, etc. with this manual or our software libraries, let us know at Oregon State University Robotics Club ORK 2011 Programming Guide Version 1.0 Updated: 10/28/2011 Note: Check back for more revisions and updates soon! If you note any errors, typos, etc. with this manual

More information

Graphs. The ultimate data structure. graphs 1

Graphs. The ultimate data structure. graphs 1 Graphs The ultimate data structure graphs 1 Definition of graph Non-linear data structure consisting of nodes & links between them (like trees in this sense) Unlike trees, graph nodes may be completely

More information

In either case, remember to delete each array that you allocate.

In either case, remember to delete each array that you allocate. CS 103 Path-so-logical 1 Introduction In this programming assignment you will write a program to read a given maze (provided as an ASCII text file) and find the shortest path from start to finish. 2 Techniques

More information

Lab 7: PID Control with Trajectory Following

Lab 7: PID Control with Trajectory Following Introduction ME460: INDUSTRIAL CONTROL SYSTEMS Lab 7: PID Control with Trajectory Following In Lab 6 you identified an approximate transfer function for both the X and Y linear drives of the XY stage in

More information

EECS192 Lecture 11 Apr. 3, 2018

EECS192 Lecture 11 Apr. 3, 2018 EECS192 Lecture 11 Apr. 3, 2018 Notes: 1. Progress Report due Tues 4/3 at beginning class 2. Check off 4/6: practice course, 5 min 3. Mon. 4/9: (6-7 pm) round 1 1. 6.5 makes first turn 2. 7 half track

More information

MS4SSA Robotics Module:

MS4SSA Robotics Module: Robotics Module: Programming and Sensors Kim Hollan Why Program a Robot? Building a robot teaches many valuable skills; however, the learning doesn t stop there Programming also teaches valuable life skills

More information

Learning Objectives. c D. Poole and A. Mackworth 2010 Artificial Intelligence, Lecture 3.2, Page 1

Learning Objectives. c D. Poole and A. Mackworth 2010 Artificial Intelligence, Lecture 3.2, Page 1 Learning Objectives At the end of the class you should be able to: demonstrate how depth-first search will work on a graph demonstrate how breadth-first search will work on a graph predict the space and

More information

Creating and Displaying Multi-Layered Cross Sections in Surfer 11

Creating and Displaying Multi-Layered Cross Sections in Surfer 11 Creating and Displaying Multi-Layered Cross Sections in Surfer 11 The ability to create a profile in Surfer has always been a powerful tool that many users take advantage of. The ability to combine profiles

More information

UNIVERSITY OF MASSACHUSETTS LOWELL Department of Electrical and Computer Engineering EXAM November 2016

UNIVERSITY OF MASSACHUSETTS LOWELL Department of Electrical and Computer Engineering EXAM November 2016 UNIVERSITY OF MASSACHUSETTS LOWELL Department of Electrical and Computer Engineering 16.322 EXAM 2 14 November 2016 Problem Weight Score 1 30 % 2 36 % 3 32 % Bonus 2 % TOTAL 100 % INSTRUCTIONS You may

More information

Solving a 2D Maze. const int WIDTH = 10; const int HEIGHT = 10;

Solving a 2D Maze. const int WIDTH = 10; const int HEIGHT = 10; Solving a 2D Maze Let s use a 2D array to represent a maze. Let s start with a 10x10 array of char. The array of char can hold either X for a wall, for a blank, and E for the exit. Initially we can hard-code

More information

CHILICON POWER GATEWAY

CHILICON POWER GATEWAY CHILICON POWER GATEWAY Visual User Manual TABLE OF CONTENTS Introduction Specifications Quick Start Guide In-Wall Installation Configuring Microinverter Extended Ranges PLC Advanced Modes Wireless Power

More information

CMPUT 396 Sliding Tile Puzzle

CMPUT 396 Sliding Tile Puzzle CMPUT 396 Sliding Tile Puzzle Sliding Tile Puzzle 2x2 Sliding Tile States Exactly half of the states are solvable, the other half are not. In the case of 2x2 puzzles, I can solve it if I start with a configuration

More information

Making a One Degree Motor Arm with Potentiometer and PID

Making a One Degree Motor Arm with Potentiometer and PID Making a One Degree Motor Arm with Potentiometer and PID Version 1.0 June 8, 2018 Introduction This guide will demonstrate the coding steps to make a motor move to desired positions using a potentiometer.

More information

Line tracking sensors and algorithms

Line tracking sensors and algorithms Line tracking sensors and algorithms Posted on February 28, 2008, by Ibrahim KAMAL, in Robotics, tagged Line tracking is a very important notion in the world of robotics as it give to the robot a precise,

More information

1 Introduction and Examples

1 Introduction and Examples 1 Introduction and Examples Sequencing Problems Definition A sequencing problem is one that involves finding a sequence of steps that transforms an initial system state to a pre-defined goal state for

More information

ENGR101 T Engineering Technology. Arthur Roberts. School of Engineering and Computer Science Victoria University of Wellington

ENGR101 T Engineering Technology. Arthur Roberts. School of Engineering and Computer Science Victoria University of Wellington ENGR101 T1 2017 Engineering Technology Arthur Roberts School of Engineering and Computer Science Victoria University of Wellington Arthur Roberts (ECS) ENGR101 1 / 32 Housekeeping Important ANNOUNCEMENT:

More information

STACKS AND QUEUES. Problem Solving with Computers-II

STACKS AND QUEUES. Problem Solving with Computers-II STACKS AND QUEUES Problem Solving with Computers-II 2 Stacks container class available in the C++ STL Container class that uses the Last In First Out (LIFO) principle Methods i. push() ii. iii. iv. pop()

More information

CS201 Discussion 12 HUFFMAN + ERDOSNUMBERS

CS201 Discussion 12 HUFFMAN + ERDOSNUMBERS CS0 Discussion HUFFMAN + ERDOSNUMBERS Huffman Compression Today, we ll walk through an example of Huffman compression. In Huffman compression, there are three steps:. Create a Huffman tree. Get all the

More information

COSC160: Data Structures: Lists and Queues. Jeremy Bolton, PhD Assistant Teaching Professor

COSC160: Data Structures: Lists and Queues. Jeremy Bolton, PhD Assistant Teaching Professor COSC160: Data Structures: Lists and Queues Jeremy Bolton, PhD Assistant Teaching Professor Outline I. Queues I. FIFO Queues I. Usage II. Implementations II. LIFO Queues (Stacks) I. Usage II. Implementations

More information

CMPSCI 250: Introduction to Computation. Lecture #24: General Search, DFS, and BFS David Mix Barrington 24 March 2014

CMPSCI 250: Introduction to Computation. Lecture #24: General Search, DFS, and BFS David Mix Barrington 24 March 2014 CMPSCI 250: Introduction to Computation Lecture #24: General Search, DFS, and BFS David Mix Barrington 24 March 2014 General Search, DFS, and BFS Four Examples of Search Problems State Spaces, Search,

More information

CS 2150 Exam 1, Spring 2018 Page 1 of 6 UVa userid:

CS 2150 Exam 1, Spring 2018 Page 1 of 6 UVa userid: CS 2150 Exam 1, Spring 2018 Page 1 of 6 UVa userid: CS 2150 Exam 1 Name You MUST write your e-mail ID on EACH page and put your name on the top of this page, too. If you are still writing when pens down

More information

Hi everyone. I hope everyone had a good Fourth of July. Today we're going to be covering graph search. Now, whenever we bring up graph algorithms, we

Hi everyone. I hope everyone had a good Fourth of July. Today we're going to be covering graph search. Now, whenever we bring up graph algorithms, we Hi everyone. I hope everyone had a good Fourth of July. Today we're going to be covering graph search. Now, whenever we bring up graph algorithms, we have to talk about the way in which we represent the

More information

CSE373: Data Structures & Algorithms Lecture 12: Amortized Analysis and Memory Locality. Linda Shapiro Winter 2015

CSE373: Data Structures & Algorithms Lecture 12: Amortized Analysis and Memory Locality. Linda Shapiro Winter 2015 CSE373: Data Structures & Algorithms Lecture 12: Amortized Analysis and Memory Locality Linda Shapiro Winter 2015 Announcements Winter 2015 CSE 373 Data structures and Algorithms 2 Amortized Analysis In

More information

CSE373: Data Structures & Algorithms Lecture 12: Amortized Analysis and Memory Locality. Lauren Milne Spring 2015

CSE373: Data Structures & Algorithms Lecture 12: Amortized Analysis and Memory Locality. Lauren Milne Spring 2015 CSE373: Data Structures & Algorithms Lecture 12: Amortized Analysis and Memory Locality Lauren Milne Spring 2015 Announcements Homework 3 due on Wednesday at 11pm Catie back Monday Spring 2015 CSE 373

More information

ME-GY 6933 Advanced Mechatronics

ME-GY 6933 Advanced Mechatronics ME-GY 6933 Advanced Mechatronics PROJECT-2 MOHIT LALA (N12051916) SHWETA VAVIYA (N17038710) OBJECTIVE The aim of this stage is to model and develop a system of two robots that localize themselves in a

More information

Unit 4: Stacks and Queues

Unit 4: Stacks and Queues Unit 4: Stacks and Queues Engineering 4892: Data Structures Faculty of Engineering & Applied Science Memorial University of Newfoundland June 1, 2011 ENGI 4892 (MUN) Unit 4 June 1, 2011 1 / 24 1 Stacks

More information

CSCI 136 Data Structures & Advanced Programming. Lecture 14 Fall 2018 Instructor: Bills

CSCI 136 Data Structures & Advanced Programming. Lecture 14 Fall 2018 Instructor: Bills CSCI 136 Data Structures & Advanced Programming Lecture 14 Fall 2018 Instructor: Bills Announcements Mid-Term Review Session Monday (10/15), 7:00-8:00 pm in TPL 203 No prepared remarks, so bring questions!

More information

Pathfinding Algorithms and Implementations on Grid Map

Pathfinding Algorithms and Implementations on Grid Map Pathfinding Algorithms and Implementations on Grid Map Steven Andrew / 13509061 Program Studi Teknik Informatika Sekolah Teknik Elektro dan Informatika Institut Teknologi Bandung, Jl. Ganesha 10 Bandung

More information

User s Manual. CAM Software CAM Programmable Encoder. Power supply 24 volts DC 8 CAM ways (6 differential + 2 single-ended)

User s Manual. CAM Software CAM Programmable Encoder. Power supply 24 volts DC 8 CAM ways (6 differential + 2 single-ended) User s Manual CAM Software CAM Programmable Encoder Power supply 24 volts DC 8 CAM ways (6 differential + 2 single-ended) Your partner for standard and special designs - precise, reliable and fast - IDE

More information

Last Updated: SHUFFLEBOARD

Last Updated: SHUFFLEBOARD Last Updated: 01-08-2018 SHUFFLEBOARD Table of Contents Getting started with Shuffleboard...3 Tour of Shuffleboard...4 Displaying data from your robot...8 Working with widgets... 14 Working with Lists...

More information

CSE 100: GRAPH ALGORITHMS

CSE 100: GRAPH ALGORITHMS CSE 100: GRAPH ALGORITHMS 2 Graphs: Example A directed graph V5 V = { V = E = { E Path: 3 Graphs: Definitions A directed graph V5 V6 A graph G = (V,E) consists of a set of vertices V and a set of edges

More information

Chapter 9 STACK, QUEUE

Chapter 9 STACK, QUEUE Chapter 9 STACK, QUEUE 1 LIFO: Last In, First Out. Stacks Restricted form of list: Insert and remove only at front of list. Notation: Insert: PUSH Remove: POP The accessible element is called TOP. Stack

More information

Pathfinding. Advaith Siddharthan

Pathfinding. Advaith Siddharthan Pathfinding Advaith Siddharthan Context What is Intelligence? Rational? Search Optimisation Reasoning Impulsive? Quicker response Less predictable Personality/Emotions: Angry/Bored/Curious Overview The

More information

Heuristic Search and Advanced Methods

Heuristic Search and Advanced Methods Heuristic Search and Advanced Methods Computer Science cpsc322, Lecture 3 (Textbook Chpt 3.6 3.7) May, 15, 2012 CPSC 322, Lecture 3 Slide 1 Course Announcements Posted on WebCT Assignment1 (due on Thurs!)

More information

11 'e' 'x' 'e' 'm' 'p' 'l' 'i' 'f' 'i' 'e' 'd' bool equal(const unsigned char pstr[], const char *cstr) {

11 'e' 'x' 'e' 'm' 'p' 'l' 'i' 'f' 'i' 'e' 'd' bool equal(const unsigned char pstr[], const char *cstr) { This document contains the questions and solutions to the CS107 midterm given in Spring 2016 by instructors Julie Zelenski and Michael Chang. This was an 80-minute exam. Midterm questions Problem 1: C-strings

More information

Graphs. The ultimate data structure. graphs 1

Graphs. The ultimate data structure. graphs 1 Graphs The ultimate data structure graphs 1 Definition of graph Non-linear data structure consisting of nodes & links between them (like trees in this sense) Unlike trees, graph nodes may be completely

More information

IS 709/809: Computational Methods in IS Research. Graph Algorithms: Introduction

IS 709/809: Computational Methods in IS Research. Graph Algorithms: Introduction IS 709/809: Computational Methods in IS Research Graph Algorithms: Introduction Nirmalya Roy Department of Information Systems University of Maryland Baltimore County www.umbc.edu Motivation Several real-life

More information

CS106X Handout 17 Winter 2015 January 28 th, 2015 CS106X Practice Exam

CS106X Handout 17 Winter 2015 January 28 th, 2015 CS106X Practice Exam CS106X Handout 17 Winter 2015 January 28 th, 2015 CS106X Practice Exam Exam Facts: When: Thursday, February 5 th from 7:00 10:00 p.m. Where: Cubberley Auditorium Coverage The exam is open-book, open-note,

More information

Rocky Coach s Notes. Grace Montagnino, Vienna Scheyer November 8, 2018

Rocky Coach s Notes. Grace Montagnino, Vienna Scheyer November 8, 2018 Rocky Coach s Notes Grace Montagnino, Vienna Scheyer November 8, 2018 1 Introduction We used an inverted pendulum model to train our rocky (an inverted pendulum robot) to stand in place, and sprint 20

More information

Heap Arrays and Linked Lists. Steven R. Bagley

Heap Arrays and Linked Lists. Steven R. Bagley Heap Arrays and Linked Lists Steven R. Bagley Recap Data is stored in variables Can be accessed by the variable name Or in an array, accessed by name and index Variables and arrays have a type Create our

More information

hw6, BFS, debugging CSE 331 Section 5 10/25/12 Slides by Kellen Donohue

hw6, BFS, debugging CSE 331 Section 5 10/25/12 Slides by Kellen Donohue hw6, BFS, debugging CSE 331 Section 5 10/25/12 Slides by Kellen Donohue Agenda hw4 being graded hw5 may be graded first, for feedback to be used on hw6 hw6 due next week Today hw6 BFS Debugging hashcode()

More information

lundi 7 janvier 2002 Blender: tutorial: Building a Castle Page: 1

lundi 7 janvier 2002 Blender: tutorial: Building a Castle Page: 1 lundi 7 janvier 2002 Blender: tutorial: Building a Castle Page: 1 www.blender.nl this document is online at http://www.blender.nl/showitem.php?id=4 Building a Castle 2000 07 19 Bart Veldhuizen id4 Introduction

More information

CS106X Handout 25 Autumn 2012 October 23 rd, 2012 CS106X Midterm Examination

CS106X Handout 25 Autumn 2012 October 23 rd, 2012 CS106X Midterm Examination CS106X Handout 25 Autumn 2012 October 23 rd, 2012 CS106X Midterm Examination This is closed book, closed notes, closed reader, closed everything exam. If you re taking the exam remotely, you can telephone

More information

EDAN30 Photorealistic Computer Graphics. Seminar 2, Bounding Volume Hierarchy. Magnus Andersson, PhD student

EDAN30 Photorealistic Computer Graphics. Seminar 2, Bounding Volume Hierarchy. Magnus Andersson, PhD student EDAN30 Photorealistic Computer Graphics Seminar 2, 2012 Bounding Volume Hierarchy Magnus Andersson, PhD student (magnusa@cs.lth.se) This seminar We want to go from hundreds of triangles to thousands (or

More information

SPARTAN ROBOTICS FRC 971

SPARTAN ROBOTICS FRC 971 SPARTAN ROBOTICS FRC 971 Controls Documentation 2015 Design Goals Create a reliable and effective system for controlling and debugging robot code that provides greater flexibility and higher performance

More information

Recursive Algorithms II

Recursive Algorithms II Recursive Algorithms II Margaret M. Fleck 23 October 2009 This lecture wraps up our discussion of algorithm analysis (section 4.4 and 7.1 of Rosen). 1 Recap Last lecture, we started talking about mergesort,

More information

CMPSCI 187: Programming With Data Structures. Review for First Midterm 9 October 2011

CMPSCI 187: Programming With Data Structures. Review for First Midterm 9 October 2011 CMPSCI 187: Programming With Data Structures Review for First Midterm 9 October 2011 Format Two hours, closed-book, no calculators, computers, etc. Question types as on practice exam: Java Concepts (10

More information

ORF 201 Computer Methods in Problem Solving. Lab 7: Maze Solver

ORF 201 Computer Methods in Problem Solving. Lab 7: Maze Solver Princeton University Department of Operations Research and Financial Engineering ORF 201 Computer Methods in Problem Solving Lab 7: Maze Solver Due Sunday, Apr 2, 11:59 pm 1. PROBLEM DESCRIPTION Is there

More information

CS-301 Data Structure. Tariq Hanif

CS-301 Data Structure. Tariq Hanif 1. The tree data structure is a Linear data structure Non-linear data structure Graphical data structure Data structure like queue FINALTERM EXAMINATION Spring 2012 CS301- Data Structure 25-07-2012 2.

More information

ISA 563 : Fundamentals of Systems Programming

ISA 563 : Fundamentals of Systems Programming ISA 563 : Fundamentals of Systems Programming Variables, Primitive Types, Operators, and Expressions September 4 th 2008 Outline Define Expressions Discuss how to represent data in a program variable name

More information

Quickstart Strategies for Commissioning and Optimization AX2000

Quickstart Strategies for Commissioning and Optimization AX2000 Quickstart Strategies for Commissioning and Optimization AX2000 Edition 06/00 Previous editions Edition Comments 06 / 00 First edition VGA is a registered trademark of International Business Machines Corp.

More information

Types, Variables, and Constants

Types, Variables, and Constants , Variables, and Constants What is a Type The space in which a value is defined Space All possible allowed values All defined operations Integer Space whole numbers +, -, x No divide 2 tj Why Types No

More information

Search. (Textbook Chpt ) Computer Science cpsc322, Lecture 2. May, 10, CPSC 322, Lecture 2 Slide 1

Search. (Textbook Chpt ) Computer Science cpsc322, Lecture 2. May, 10, CPSC 322, Lecture 2 Slide 1 Search Computer Science cpsc322, Lecture 2 (Textbook Chpt 3.0-3.4) May, 10, 2012 CPSC 322, Lecture 2 Slide 1 Colored Cards You need to have 4 colored index cards Come and get them from me if you still

More information

CS 136: Advanced Architecture. Review of Caches

CS 136: Advanced Architecture. Review of Caches 1 / 30 CS 136: Advanced Architecture Review of Caches 2 / 30 Why Caches? Introduction Basic goal: Size of cheapest memory... At speed of most expensive Locality makes it work Temporal locality: If you

More information

CS453 Arrays in Java in general

CS453 Arrays in Java in general Plan for the day - - Arrays in general -- Array descriptors -- Type checking for arrays -- Code gen for arrays CS453 Arrays in Java in general CS453 Lecture Arrays 1 Arrays An array is a collection of

More information

DIT411/TIN175, Artificial Intelligence. Peter Ljunglöf. 19 January, 2018

DIT411/TIN175, Artificial Intelligence. Peter Ljunglöf. 19 January, 2018 DIT411/TIN175, Artificial Intelligence Chapter 3: Classical search algorithms CHAPTER 3: CLASSICAL SEARCH ALGORITHMS DIT411/TIN175, Artificial Intelligence Peter Ljunglöf 19 January, 2018 1 DEADLINE FOR

More information

MXCuBE3 release, and deployment at ESRF

MXCuBE3 release, and deployment at ESRF 1 MXCuBE3 release, and deployment at ESRF Page 2 Outline Page 3 Review of main drivers Improving user experience MXCuBE on the web UI Overview Demo video(s) Introducing MXCuBE3 After almost two and half

More information

Spanning trees. Suppose you have a connected undirected graph

Spanning trees. Suppose you have a connected undirected graph Spanning Trees Spanning trees Suppose you have a connected undirected graph Connected: every node is reachable from every other node Undirected: edges do not have an associated direction...then a spanning

More information

// The next 4 functions return true on success, false on failure

// The next 4 functions return true on success, false on failure Stacks and Queues Queues and stacks are two special list types of particular importance. They can be implemented using any list implementation, but arrays are a more practical solution for these structures

More information

Intermediate Representations

Intermediate Representations Intermediate Representations Intermediate Representations (EaC Chaper 5) Source Code Front End IR Middle End IR Back End Target Code Front end - produces an intermediate representation (IR) Middle end

More information

Bits, Words, and Integers

Bits, Words, and Integers Computer Science 52 Bits, Words, and Integers Spring Semester, 2017 In this document, we look at how bits are organized into meaningful data. In particular, we will see the details of how integers are

More information

CS102: Variables and Expressions

CS102: Variables and Expressions CS102: Variables and Expressions The topic of variables is one of the most important in C or any other high-level programming language. We will start with a simple example: int x; printf("the value of

More information

Fundamentals of lambda tuning

Fundamentals of lambda tuning Fundamentals of lambda tuning Understanding a particularly conservative PID controller design technique. Vance VanDoren, PhD, PE 04/16/2013 Lambda tuning is a form of internal model control (IMC) that

More information

Simulink Basics Tutorial

Simulink Basics Tutorial Simulink Basics Tutorial Simulink is a graphical extension to MATLAB for modeling and simulation of systems. One of the main advantages of Simulink is the ability to model a nonlinear system, which a transfer

More information

Deseo KNX Manual. Deseo KNX. Manual. basalte bvba hundelgemsesteenweg 1a 9820 merelbeke belgium. 1 / 65 v basalte

Deseo KNX Manual. Deseo KNX. Manual. basalte bvba hundelgemsesteenweg 1a 9820 merelbeke belgium. 1 / 65 v basalte Deseo KNX basalte bvba hundelgemsesteenweg 1a 9820 merelbeke belgium 1 / 65 v2.3 2012 basalte Table of contents: 1. Introduction... 5 2. Installation... 6 2.1 Identifying the parts... 7 2.1.1 Front view

More information

But first, encode deck of cards. Integer Representation. Two possible representations. Two better representations WELLESLEY CS 240 9/8/15

But first, encode deck of cards. Integer Representation. Two possible representations. Two better representations WELLESLEY CS 240 9/8/15 Integer Representation Representation of integers: unsigned and signed Sign extension Arithmetic and shifting Casting But first, encode deck of cards. cards in suits How do we encode suits, face cards?

More information

Problem Set 8 Solutions

Problem Set 8 Solutions Introduction to Algorithms November 22, 25 Massachusetts Institute of Technology 6.46J/8.4J Professors Erik D. Demaine and Charles E. Leiserson Handout 27 Problem Set 8 Solutions Problem 8-. No left turns

More information

Lecture Notes. char myarray [ ] = {0, 0, 0, 0, 0 } ; The memory diagram associated with the array can be drawn like this

Lecture Notes. char myarray [ ] = {0, 0, 0, 0, 0 } ; The memory diagram associated with the array can be drawn like this Lecture Notes Array Review An array in C++ is a contiguous block of memory. Since a char is 1 byte, then an array of 5 chars is 5 bytes. For example, if you execute the following C++ code you will allocate

More information

Uniformed Search (cont.)

Uniformed Search (cont.) Uniformed Search (cont.) Computer Science cpsc322, Lecture 6 (Textbook finish 3.5) Sept, 16, 2013 CPSC 322, Lecture 6 Slide 1 Lecture Overview Recap DFS vs BFS Uninformed Iterative Deepening (IDS) Search

More information

21. PID control The theory of PID control

21. PID control The theory of PID control 1 21. PID control The PID (Proportional Integral Differential) controller is a basic building block in regulation. It can be implemented in many different ways, this example will show you how to code it

More information

Copyright 2003, Keith D. Cooper, Ken Kennedy & Linda Torczon, all rights reserved. Students enrolled in Comp 412 at Rice University have explicit

Copyright 2003, Keith D. Cooper, Ken Kennedy & Linda Torczon, all rights reserved. Students enrolled in Comp 412 at Rice University have explicit Intermediate Representations Copyright 2003, Keith D. Cooper, Ken Kennedy & Linda Torczon, all rights reserved. Students enrolled in Comp 412 at Rice University have explicit permission to make copies

More information

Keeping Order:! Stacks, Queues, & Deques. Travis W. Peters Dartmouth College - CS 10

Keeping Order:! Stacks, Queues, & Deques. Travis W. Peters Dartmouth College - CS 10 Keeping Order:! Stacks, Queues, & Deques 1 Stacks 2 Stacks A stack is a last in, first out (LIFO) data structure Primary Operations: push() add item to top pop() return the top item and remove it peek()

More information

Chapter 5.4 Artificial Intelligence: Pathfinding

Chapter 5.4 Artificial Intelligence: Pathfinding Chapter 5.4 Artificial Intelligence: Pathfinding Introduction Almost every game requires pathfinding Agents must be able to find their way around the game world Pathfinding is not a trivial problem The

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

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

Backtracking. See Section 7.7 p of Weiss

Backtracking. See Section 7.7 p of Weiss Backtracking See Section 7.7 p 333-336 of Weiss So far we have looked at recursion in general, looked at Dynamic Programming as a way to make redundant recursions less inefficient, and noticed that recursion

More information

Using the CRM Pivot Tables

Using the CRM Pivot Tables Using the CRM Pivot Tables Pivot tables have now been added to your CRM system: we hope that these will provide you with an easy way to produce charts and graphs straight from your CRM, using the most

More information

Interrupts, timers and counters

Interrupts, timers and counters Interrupts, timers and counters Posted on May 10, 2008, by Ibrahim KAMAL, in Micro-controllers, tagged Most microcontrollers come with a set of ADD-ONs called peripherals, to enhance the functioning of

More information

The Maze Runner. Alexander Kirillov

The Maze Runner. Alexander Kirillov The Maze Runner URL: http://sigmacamp.org/mazerunner E-mail address: shurik179@gmail.com Alexander Kirillov This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License.

More information

Treasure Map. Output. Output a single integer, which is the maximum amount of gold that you can collect.

Treasure Map. Output. Output a single integer, which is the maximum amount of gold that you can collect. Treasure Map You have found a treasure map! The map leads you to several gold mines. The mines each produce gold each day, but the amount of gold that they produce diminishes each day. There are paths

More information

1.2 Adding Integers. Contents: Numbers on the Number Lines Adding Signed Numbers on the Number Line

1.2 Adding Integers. Contents: Numbers on the Number Lines Adding Signed Numbers on the Number Line 1.2 Adding Integers Contents: Numbers on the Number Lines Adding Signed Numbers on the Number Line Finding Sums Mentally The Commutative Property Finding Sums using And Patterns and Rules of Adding Signed

More information

CS 112 Introduction to Computing II. Wayne Snyder Computer Science Department Boston University

CS 112 Introduction to Computing II. Wayne Snyder Computer Science Department Boston University CS 11 Introduction to Computing II Wayne Snyder Department Boston University Today Object-Oriented Programming Concluded Stacks, Queues, and Priority Queues as Abstract Data Types Reference types: Basic

More information

Lecture 3: Queues, Testing, and Working with Code

Lecture 3: Queues, Testing, and Working with Code Lecture 3: Queues, Testing, and Working with Code Data Structures and Algorithms CSE 373 SU 18 BEN JONES 1 Clearing up Stacks CSE 373 SU 18 BEN JONES 2 Clearing up Stacks CSE 373 SU 18 BEN JONES 3 Clearing

More information

18-642: Code Style for Compilers

18-642: Code Style for Compilers 18-642: Code Style for Compilers 9/25/2017 1 Anti-Patterns: Coding Style: Language Use Code compiles with warnings Warnings are turned off or over-ridden Insufficient warning level set Language safety

More information

COS 226 Algorithms and Data Structures Fall Midterm

COS 226 Algorithms and Data Structures Fall Midterm COS 226 Algorithms and Data Structures Fall 2017 Midterm This exam has 10 questions (including question 0) worth a total of 55 points. You have 0 minutes. This exam is preprocessed by a computer, so please

More information

CSCI 204 Introduction to Computer Science II

CSCI 204 Introduction to Computer Science II CSCI 204 Project 2 Maze Assigned: Wednesday 09/27/2017 First Phase (Recursion) Due Friday, 10/06/2017 Second Phase (Stack) Due Monday, 10/16/2017 1 Objective The purpose of this assignment is to give you

More information

Mach4 CNC Controller Screen Editing Guide Version 1.0

Mach4 CNC Controller Screen Editing Guide Version 1.0 Mach4 CNC Controller Screen Editing Guide Version 1.0 1 Copyright 2014 Newfangled Solutions, Artsoft USA, All Rights Reserved The following are registered trademarks of Microsoft Corporation: Microsoft,

More information

New and Improved Formula Editor in JMP 13

New and Improved Formula Editor in JMP 13 These are the step-by-step instructions for the 'New and Improved Formula Editor in JMP 13' demo. This contains talking points and also the demo steps. Demo instructions are underlined and in bold to highlight

More information

DATA STRUCTURE AND ALGORITHM USING PYTHON

DATA STRUCTURE AND ALGORITHM USING PYTHON DATA STRUCTURE AND ALGORITHM USING PYTHON Advanced Data Structure and File Manipulation Peter Lo Linear Structure Queue, Stack, Linked List and Tree 2 Queue A queue is a line of people or things waiting

More information

CSE 373: Data Structures and Algorithms

CSE 373: Data Structures and Algorithms CSE 373: Data Structures and Algorithms Lecture 15: Graph Data Structures, Topological Sort, and Traversals (DFS, BFS) Instructor: Lilian de Greef Quarter: Summer 2017 Today: Announcements Graph data structures

More information

Logic, Words, and Integers

Logic, Words, and Integers Computer Science 52 Logic, Words, and Integers 1 Words and Data The basic unit of information in a computer is the bit; it is simply a quantity that takes one of two values, 0 or 1. A sequence of k bits

More information

COMP 250 Fall recurrences 2 Oct. 13, 2017

COMP 250 Fall recurrences 2 Oct. 13, 2017 COMP 250 Fall 2017 15 - recurrences 2 Oct. 13, 2017 Here we examine the recurrences for mergesort and quicksort. Mergesort Recall the mergesort algorithm: we divide the list of things to be sorted into

More information

SELF-BALANCING SEARCH TREES. Chapter 11

SELF-BALANCING SEARCH TREES. Chapter 11 SELF-BALANCING SEARCH TREES Chapter 11 Tree Balance and Rotation Section 11.1 Algorithm for Rotation BTNode root = left right = data = 10 BTNode = left right = data = 20 BTNode NULL = left right = NULL

More information

Version 1.1 JEFFERSON LAB. Data Acquisition Group. JEventViewer User s Guide

Version 1.1 JEFFERSON LAB. Data Acquisition Group. JEventViewer User s Guide Version 1.1 JEFFERSON LAB Data Acquisition Group JEventViewer User s Guide J E F F E R S O N L A B D A T A A C Q U I S I T I O N G R O U P JEventViewer User s Guide Carl Timmer timmer@jlab.org 3-Feb-2015

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

Contents. 1 Register and Configure Hi-Gate Add Sensor Node Create a Fresh New Project... 6

Contents. 1 Register and Configure Hi-Gate Add Sensor Node Create a Fresh New Project... 6 Contents 1 Register and Configure Hi-Gate... 2 1.1 Add Sensor Node... 4 1.2 Create a Fresh New Project... 6 1.3 Project Testing on Real Hardware... 9 1.4 Troubleshoot Guide... 10 2 Connection Modes: WiFi,

More information