Topics in Programming Reactive Systems Prof. Ronen Brafman and Dr. Gera Weiss.

Slides:



Advertisements
Similar presentations
Testing Relational Database
Advertisements

NEURAL NETWORKS Perceptron
Damian Gordon.  Static Testing is the testing of a component or system at a specification or implementation level without execution of the software.
Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 1 1 Disciplined Software Engineering Lecture #7 Software Engineering.
Group Techniques John A. Cagle California State University, Fresno.
Plan to succeed in school … using Study Skills
API Design CPSC 315 – Programming Studio Fall 2008 Follows Kernighan and Pike, The Practice of Programming and Joshua Bloch’s Library-Centric Software.
1 Introduction to Computability Theory Lecture15: Reductions Prof. Amos Israeli.
CS 290C: Formal Models for Web Software Lecture 10: Language Based Modeling and Analysis of Navigation Errors Instructor: Tevfik Bultan.
Multiprocessing Memory Management
CS350/550 Software Engineering Lecture 1. Class Work The main part of the class is a practical software engineering project, in teams of 3-5 people There.
Testing an individual module
A. Frank - P. Weisberg Operating Systems Introduction to Cooperating Processes.
Reducing Cache Misses 5.1 Introduction 5.2 The ABCs of Caches 5.3 Reducing Cache Misses 5.4 Reducing Cache Miss Penalty 5.5 Reducing Hit Time 5.6 Main.
OHT 9.1 Galin, SQA from theory to implementation © Pearson Education Limited 2004 Chapter 9.3 Software Testing Strategies.
Transaction. A transaction is an event which occurs on the database. Generally a transaction reads a value from the database or writes a value to the.
CEN th Lecture CEN 4021 Software Engineering II Instructor: Masoud Sadjadi Change Control.
Reaching Goals: Plans and Controls
SESSION ONE PERFORMANCE MANAGEMENT & APPRAISALS.
1 Shawlands Academy Higher Computing Software Development Unit.
1 Software Testing (Part-II) Lecture Software Testing Software Testing is the process of finding the bugs in a software. It helps in Verifying and.
Managing the development and purchase of information systems (Part 1)
Chapter 11 Management Skills
Operating System Concepts and Techniques Lecture 5 Scheduling-1 M. Naghibzadeh Reference M. Naghibzadeh, Operating System Concepts and Techniques, First.
Teaching material for a course in Software Project Management & Software Engineering – part II.
Z26 Project Management Introduction lecture 1 13 th January 2005
Putting together a complete system Chapter 10. Overview  Design a modest but complete system  A collection of objects work together to solve a problem.
Art 315 Lecture 5 Dr. J. Parker AB 606. Last time … We wrote our first program. We used a tool called GameMaker. The program we wrote causes a ball to.
SOFTWARE DESIGN.
Observation & Analysis. Observation Field Research In the fields of social science, psychology and medicine, amongst others, observational study is an.
Disciplined Software Engineering Lecture #7 Software Engineering Institute Carnegie Mellon University Pittsburgh, PA Sponsored by the U.S. Department.
Testing -- Part II. Testing The role of testing is to: w Locate errors that can then be fixed to produce a more reliable product w Design tests that systematically.
SE: CHAPTER 7 Writing The Program
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 5: Software Design & Testing; Revision Session.
CS 350, slide set 5 M. Overstreet Old Dominion University Spring 2005.
Software Construction Lecture 18 Software Testing.
Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 7 1 Design and Code Reviews - Overview What are design and code.
STEP 4 Manage Delivery. Role of Project Manager At this stage, you as a project manager should clearly understand why you are doing this project. Also.
Apply Quality Management Techniques Project Quality Processes Certificate IV in Project Management Qualification Code BSB41507 Unit Code BSBPMG404A.
Games Development 2 Overview & Entity IDs and Communication CO3301 Week 1.
Introduction Object oriented design is a method where developers think in terms of objects instead of procedures or functions. SA/SD approach is based.
The Software Development Process
Lecture 5 Page 1 CS 111 Online Processes CS 111 On-Line MS Program Operating Systems Peter Reiher.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Chapter 1: Fundamental of Testing Systems Testing & Evaluation (MNN1063)
Architecture View Models A model is a complete, simplified description of a system from a particular perspective or viewpoint. There is no single view.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
CSCI1600: Embedded and Real Time Software Lecture 23: Real Time Scheduling I Steven Reiss, Fall 2015.
1 Program Development  The creation of software involves four basic activities: establishing the requirements creating a design implementing the code.
Modelling the Process and Life Cycle. The Meaning of Process A process: a series of steps involving activities, constrains, and resources that produce.
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
1 The Software Development Process ► Systems analysis ► Systems design ► Implementation ► Testing ► Documentation ► Evaluation ► Maintenance.
2/22/2016© Hal Perkins & UW CSEP-1 CSE P 501 – Compilers Register Allocation Hal Perkins Winter 2008.
CMPSC 16 Problem Solving with Computers I Spring 2014 Instructor: Tevfik Bultan Lecture 4: Introduction to C: Control Flow.
Slides created by: Professor Ian G. Harris Operating Systems  Allow the processor to perform several tasks at virtually the same time Ex. Web Controlled.
Certificate IV in Project Management Assessment Outline Course Number Qualification Code BSB41507.
Certificate IV in Project Management Assessment Outline Course Number Qualification Code BSB41507.
Top Ten Skills for High- School Students Whether you're a freshman or a senior, developing the following ten skills will help you achieve success in school,
4 - Conditional Control Structures CHAPTER 4. Introduction A Program is usually not limited to a linear sequence of instructions. In real life, a programme.
Introduction to operating systems What is an operating system? An operating system is a program that, from a programmer’s perspective, adds a variety of.
LECTURE 19 Subroutines and Parameter Passing. ABSTRACTION Recall: Abstraction is the process by which we can hide larger or more complex code fragments.
Writing and updating strategic and annual plans Richard Maggs Astana September 2014.
Lecture 5 Page 1 CS 111 Summer 2013 Bounded Buffers A higher level abstraction than shared domains or simple messages But not quite as high level as RPC.
Unit Testing CLUE PLAYERS.  How much design do we do before we begin to code?  Waterfall: Design it all! (slight exaggeration… but not much)  Agile:
Advanced Higher Computing Science
Multiple Writers and Races
Software testing strategies 2
Chapter 13: Construction
CS510 Operating System Foundations
Presentation transcript:

Topics in Programming Reactive Systems Prof. Ronen Brafman and Dr. Gera Weiss

Goal Learn, and help us refine a new methodology for developing reactive systems and autonomous systems – This means that what we describe are guidelines, and that you are free to structure your code as you wish, provided you keep the basic ideas Use this methodology to develop players for robocode

Robocode information, tutorials, code, suggested strategies, etc. file://localhost/Users/Brafman/robocode/rob ocode.command file://localhost/Users/Brafman/robocode/rob ocode.command

Course Schedule and Work Load 14/3: Lecture a. Description of course goal b. Description of robocode c. Description of the programming methodology. 21/3: Assignment due: simple, hand coded robocode agent 28/3: Lecture + Assignment due: List of b-threads, their description, and their place in the hierarchy a. 18/4: Student Lectures Describe agent design and methodology support. 10 min each pair – Assignment due: Methodology support and critiquing document – max 2 pages 2/5: Assignment due: Player code + documentation + time report 23/5: Student Lecture. Students describe agent team design 10 minutes each. 1/7: Assignment due: a. Team code b. Architecture document – max 3 pages c. Methodology support and critiquing – max 2 pages d. Time report.

Requirements and Grade Attend all lectures – Both students should be prepared to present their architecture in both cases Submit all assignments in time and receive a passing grade on each assignment – Submission in pairs Grade: assuming you meet all above requirements, your grade will be: – Simple player: 5 pts – Agent architecture description: 10 pts – Agent architecture document: 10 pts – Agent code submitted on time with proper documentation and using proper methodology 15 – Agent performance 5 – Team architecture description: 10 pts – Team architecture document: 10 pts – Team code submitted on time with proper documentation and using proper methodology 20 pts – Team performance 15 pts – Time logs submitted 5 pts

(flat) Behavioral Programming Basic idea: write behaviors (called b-threads) – almost standalone threads that deal with one aspect of the problem you care about – each behavior can ask for “actions” to be done, and for other actions not to be done “blocked” – a coordinator receives all requests, and selects an action that was requested but not blocked, and informs the thread on its selection – Each thread continues as it code specifies. The code will say how to react to some changes/actions It does nothing when others occur – behaviors can only change their own state based on events, and make a request to execute/block – they cannot actually carry out an action, only the coordinator can When the overall behavior is missing something, add a new behavior – It will either request something that was not requested or block some undesirable behavior Motivation: – We never get a complex system right the first time – We want an incremental modification process -- add new behaviors that handle the problem Example: quad-rotor

Important Principle – Try to Focus Try to write behaviors that achieve, or maintain something concrete – Prevent collision – Save fuel – Reach target quickly We will soon see how to combine them – Some b-threads will be in charge of “orchestrating” these behaviors

Weights Actually, rather than ask for an event/action, b- threads vote. Each b-thread votes for/against each behavior it cares about, by assigning it some weight. – Positive weight – wants to see it take place – Negative weight – prefers not to see it – 0 – don’t care – - ∞ -- absolutely forbiden The coordinator will combine these “votes” and select the action with highest value

Important Principle: Consider/ Program Many Options In standard code, a thread/procedure etc. can request (or directly activate) some function/actuator/action In BP, a thread does not know whether its favorite choice will be executed It needs to consider many actions: either ask for them, or ask that they will not take place – You like Bibi, but maybe he won’t be selected. So let the coordinator know what you think about Liberman, or Mofaz So you should program many ways to implement things, so that in case one is blocked, the others may be acceptible Remember – the worse thing is for the coordinator not to have any valid choice

Structure of a b-thread Regular code that keeps track of state variables and external events in order to achieve (or maintain) some goal: - Keep vehicle stable, or – Prevent collisions, or – Pickup an object Whenever it wants something done, uses a b- synch statement to vote for behaviors/actions that achieve what it needs now – Need to define a “vote” object that is basically the value of a b-synch statement

Synchronization To support this, we need a synchronization thread – Waits for all relevant requests (i.e., b-synchs) – Decides what to do based on the votes – Informs the b-threads about the action that was selected (so they can update their state, and continue along the correct branch)

Synchronization Many options! Many ways of implementing: – Via continuations (you store the state of the procedure before a b-synch, and continue later after decision) – Via real threads Many design choices: – How much time to wait for a decision? – Do we need to wait for all relevant b-threads? – Various “standing” requests” – don’t do X until I say so

Hierarchy It is impossible to build large systems without some hierarchy and structure Our methodology has some clear guidelines on this, which also help decompose the problem – We focus on a linear hierarchy – Each level has a set of b-threads + own coordinator – Each level defines a set “actions” for the level above One typical action allows us to set the priority of b-threads Others allow us to set other parameters Others allow us to activate a b-thread

Top-Down Design Top level (0): single b-thread called “success” Level 1: one b-thread for every goal/success criteria – Robocode: kill, stay alive “Success” b-thread sets the priority of level 1 criteria – Can be static (fixed weight) – Can be dynamic (update weight based on events)

Top-Down Design Threads at level i+1 describe behaviors that are relevant to some (possibly many) threads at level i. – “Kill” will vote for various behaviors that can destroy other tanks Various techniques for shooting other tanks – “Stay alive” will vote for various behaviors that make it hard to hit our tank – Various strategies for moving or hiding can used by b-threads that support kill/stay alive