EE/CpE 345. Modeling and Simulation. Fall Class 4 September 23, 2002
|
|
- Andrew Aron Cameron
- 5 years ago
- Views:
Transcription
1 EE/CpE 345 Modeling and Simulation Class 4 September 23, 2002
2 This week s topics Simulation software Continuation of wireless simulation example
3 Simulation Software General purpose programming languages FORTRAN C/C++ Simulation programming languages GPSS/H SIMIAN V Simulation environments OpNet Matlab Simulink
4 Evolution of simulation software FORTRAN Simscript GASP SLAM II SIMIAN ALGOL PASCAL C Simula C++ Matlab GPSS GPSS/H CSIM Simulink Arena AutoMod OpNet General purpose Languages Simulation languagess Simulation environments
5 Some Guidelines on Simulation Software Selection Consider multiple broad issues: Ease of use, accuracy, support, training, applicability to problem Execution speed is important: slow speed during debugging can impede development Caveat Emptor vendors sometimes lie Try before you buy run on sample problems. Evaluation downloads are extremely important (e.g., MathWorks offers complete 30 day evaluation copy) Beware of simple feature lists Extending package with your own C (et. al.) routines is extremely important Graphical interface is easiest for describing process flow. Programming language-like routines are best for describing procedural steps. You ll need both. Sophisticated graphical display of complex output is essential (e.g., 3-D graphs)
6 Model-building features Feature Model world view Input data analysis Graphical model building Conditional routing Simulation programming Syntax Input flexibility Conciseness Randomness Specialized components User-built custom objects Interface with GPL Function Process interaction, events Estimate distributions from raw data Block diagrams to illustrate process flow, functional blocks, network Route entities thru simulation based on state of system Interface to allow programmatic control of simulation, preferably in standard HLL Easily understood, consistent, unambiguous, similar to a language user already understands Accepts data from external sources, e.g., sensors, files, user Powerful actions, blocks, or nodes Random process generators for common distributions. Ability to randomize or repeat same sequence Off-the-shelf components for your particular problem Reusable objects, templates, and sub-models. Ideally, they should be indistinguishable from built-in features E.g., model is C-callable, Model can include C routines
7 Runtime Environment Feature Execution speed Model size Interactive debugger Model status and statistics Runtime license Function Many short runs are needed during debugging. Long runs are needed during experimentation. Fast startup as well as efficient execution are required. Ability to compile/optimize/profile model needed There should be no hard limits, other than those imposed by platform you are running on (e.g., available RAM, hard disk space) Breakpoints, trap event, run until condition, single step, error recovery Display at any time during simulation Ability to design a model and then run it with same structure but different parameters on multiple platforms simultaneously. At $30k per license for some packages, you don t want to have to buy 10 licenses to run 10 instances of same simulation
8 Simulation example Example 4.1: Grocery Checkout Single server queue Run until 1000 customers have been served Customer arrival times: exponentially distributed with 4.5 minute average interarrival time Service time: Normally distributed with mean 3.2 minutes, standard deviation.6 minutes Simulate with C++, GPSS/H, CSIM
9 Simulation example in C++ // declarations of types and variables class Event { friend bool operator<(const Event& e1, const Event& e2); friend bool operation==(const Event& e1, const Event& e2); public: Event(); Enum EvtType { arrival, departure; Event(EvtType type, double etime) : _type(type), _etime(etime){ EvtType get_type() { return _type; double get_time() { return _etime; protected: EvtType _type; double _etime; priority_queue<event> FutureEventList; queue<event> Customers; // declaration of global variables // main routine
10 Simulation example in C++ // declarations of types and variables main() { // start simulation // get input parameters Initialization(); while(numberofdepartures < TotalCustomers) { Event evt = FutureEventList.top(); // get imminent event FutureEventList.pop(); // remove from queue Clock = evt.get_time(); // advance clock if( evt.get_type() == Event::arrival ) ProcessArrival(evt); else ProcessDeparture(evt); ReportGeneration();
11 Simulation example in C++ void Initialization() { // initialize global variables Clock = 0; //... // create first arrival event Event evt(event::arrival, exponential(meaninterarrivaltime)); FutureEventList.push(evt);
12 Simulation example in C++ void ProcessArrival(Event evt) { Customers.push(evt); // put on Customers queue QueueLength++; // increment number waiting // if idle, fetch event, update stats, put in service if (NumberInService == 0) ScheduleDeparture(); else TotalBusy += (Clock + LastEventTime); // adjust max queue length statistics if(maxqueuelength < QueueLength) MaxQueuelength = QueueLength; // schedule next arrival Event next_arrival(event::arrival, Clock+exponential(MeanIntervalArrivalTime)); FutureEventList.push(next_arrival); LastEventTime = Clock;
13 Simulation example in C++ double exponential(double mean) { return -mean*log( unif() ); double SaveNormal; int NumNormals = 0; #define PI double normal(double mean, double sigma) { //normal variates are generated in pairs. You return one, then the other double ReturnNormal; if(numnormals == 0) { double r1 = unif(); double r2 = unif(); ReturnNormal = sqrt(-2*log(r1))*cos(2*pi*r2); SaveNormal = sqrt(-2*log(r1))*sin(2*pi*r2); NumNormals=1; else { NumNormals=0; ReturnNormal = SaveNormal; return ReturnNormal*sigma + mean;
14 Simulation in GPSS SIMULATE * Define variables INTEGER &LIMIT REAL &IAT, &MEAN, &STDEV, &COUNT LET &IAT = * Copy input data to file, remember GPSS is FORTRAN based, so this follows the FORMAT command in FORTRAN PUTPIC FILE=OUT, LINES=5, (&IAT, &MEAN, &STDEV, &LIMIT) Mean interarrival time **.** minutes Mean service time **.** minutes... * GPSS/H Block Section GENERATE RVEXPO(1,$IAT) Exponential arrivals QUEUE SYSTIME QUEUE LINE Customer joins line SIEZE CHECKOUT begin checkout DEPART LINE ADVANCE RVNORM(1,&MEAN, &STDEV) service time RELEASE CHECKOUT End response time DEPART SYSTIME TEST GE M1, 4, TER is response time >= 4 minutes? BLET &COUNT=&COUNT-1 if so, add 1 to customer TER TERMINATE 1 START &LIMIT Run until LIMIT reached * Write output to file END
15 Simulation in CSIM event done( done ); //define event named done facility( f ); //define facility f // define variables long TotalCustomers; long NumberOfCustomers=0;... void customer(); //forward definition extern C void sim() //main process { create( sim ); // procedure is a process MeanServiceTime = 3.2; //initialize variables for(long i=1; i<=totalcustomers;i++) {// hold for an interarrival period hold(exponential(meaninterarrivaltime)); customer(): // generate a new customer process done.wait(); //wait for last customer ReportGeneration(); //generate a report
16 Simulation in CSIM void customer() { create( customer ); //update MaxQueueLength long length = f.qlength() + f.num_busy(); if( length && MaxQueueLength < length) MaxQueueLength = length; // sample service time, update LongService double service; while( (service = normal(meanservicetime, SIGMA) ) < 0); f.use(service); //queue up for service if( service > 4.0 ) LongService++; if(++numberofcustomers == TotalCustomers) //done? done.set(); // yes, signal main
17 Some Conclusions to Draw C and C++ weren t designed for simulation, but if you take care of the details, they can serve well GPSS is a language written specifically for simulation, but it is based on old concepts (e.g., not a procedural oriented language like Algol, C, etc.) Starting with C++, simple extensions can be added with objects and operator overloading to create an efficient simulation language, like CSIM
18 Common characteristics: GUI based, Animated graphics Automatic data collection Simulation Packages Arena modeling of business processes built on SIMIAN AutoMod focus on material handling and manufacturing processes generated AVI movies of 3D animations, with pan/zoom Deneb/QUEST robotic simulation OpNet Modeler/IT Guru graphical modeling of complex networks Matlab/SIMULINK block diagram focus focus on scientific/technical applications rich set of Blocksets/Toolboxes MathCAD equation-based worksheets includes symbolic programming (e.g., simplification/expansion of equations)
19 Trends in Simulation Packages High-fidelity simulation High-accuracy simulation of complex systems Data exchange standards Simulation input/output can be interfaced to other packages Distributed (client/server) computing support Large organization/wide-area collaboration (e.g., across LAN, Internet) General purpose simulations vs. specialized simulations Do it once, make it reusable Richer object libraries/reusable blocksets Multiple computer simulations to accelerate simulations
20 A Simulink Model User and Node Positions
21 Implementation Directions Top Down Define high level structure first, fill in details Nothing is working until the details are done Bottom Up Define the details first, stitch them together Interfaces will change as more details are defined Straight through Start at system input, progress through to final output (or vice versa) Outside In Front and back interfaces are defined first, interior details later, meet in middle Pieces may not join at the center properly Inside Out Inner connections are completed, outer pieces are added There is something to test from the beginning
22 Homework #3 Due 9/30/02 1. Translate the C++ simulation discussed today (complete version in Chapter 4), into your favorite language (C, Pascal, C++, Matlab, Java, etc. should be straightforward). 2. Modify simulation to simulate a three server queue, exponential arrivals, MeanArrivalTime=2, Normal service times, MeanServiceTime =(1,2,3), Sigma=(.5,1,1.5), 1000 customers. Output report to include server 1,2,3 utilization, maximum response time, histogram (plot) of customer time in system (minimum of 20 bins).
Event Scheduling Algorithm. Event Notice and Future Event List. Discrete Event Simulation. Event Scheduling Based on FEL
Event Scheduling Algorithm Spreadsheet simulation tables for individual applications are structured in ad hoc ways. For larger applications, the approach can be unbearably complex. A more general, common
More informationGeneral Simulation Principles
1 / 24 General Simulation Principles Christos Alexopoulos and Dave Goldsman Georgia Institute of Technology, Atlanta, GA, USA 10/16/17 2 / 24 Outline 1 Steps in a Simulation Study 2 Some Definitions 3
More informationCSCI-1200 Data Structures Spring 2018 Lecture 14 Associative Containers (Maps), Part 1 (and Problem Solving Too)
CSCI-1200 Data Structures Spring 2018 Lecture 14 Associative Containers (Maps), Part 1 (and Problem Solving Too) HW6 NOTE: Do not use the STL map or STL pair for HW6. (It s okay to use them for the contest.)
More informationShort Notes of CS201
#includes: Short Notes of CS201 The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with < and > if the file is a system
More informationCS201 - Introduction to Programming Glossary By
CS201 - Introduction to Programming Glossary By #include : The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with
More informationPerformance Evaluation. Recommended reading: Heidelberg and Lavenberg Computer Performance Evaluation IEEETC, C33, 12, Dec. 1984, p.
Thomas Clark 5/4/09 cs162 lecture notes cs162-aw Performance Evaluation Recommended reading: Heidelberg and Lavenberg Computer Performance Evaluation IEEETC, C33, 12, Dec. 1984, p. 1195 We ve been talking
More informationFuture Directions in Simulation Modeling. C. Dennis Pegden
Future Directions in Simulation Modeling C. Dennis Pegden Outline A half century of progress. Where do we need to go from here? How do we get there? Simulation: A Compelling Technology See the future Visualize
More informationG. Tardiani RoboCup Rescue. EV3 Workshop Part 1 Introduction to RobotC
RoboCup Rescue EV3 Workshop Part 1 Introduction to RobotC Why use RobotC? RobotC is a more traditional text based programming language The more compact coding editor allows for large programs to be easily
More informationMATLAB is a multi-paradigm numerical computing environment fourth-generation programming language. A proprietary programming language developed by
1 MATLAB is a multi-paradigm numerical computing environment fourth-generation programming language. A proprietary programming language developed by MathWorks In 2004, MATLAB had around one million users
More informationSimulative Evaluation of Internet Protocol Functions
Simulative Evaluation of Internet Protocol Functions Introduction Course Objectives & Introduction Performance Evaluation & Simulation A Manual Simulation Example Resources http://www.tu-ilmenau.de/fakia/simpro.html
More informationComputer Systems Performance Analysis and Benchmarking (37-235)
Computer Systems Performance Analysis and Benchmarking (37-235) Analytic Modeling Simulation Measurements / Benchmarking Lecture by: Prof. Thomas Stricker Assignments/Projects: Christian Kurmann Textbook:
More informationInheritance and Interfaces
Inheritance and Interfaces Object Orientated Programming in Java Benjamin Kenwright Outline Review What is Inheritance? Why we need Inheritance? Syntax, Formatting,.. What is an Interface? Today s Practical
More informationCSCI-1200 Data Structures Fall 2018 Lecture 22 Hash Tables, part 2 & Priority Queues, part 1
Review from Lecture 21 CSCI-1200 Data Structures Fall 2018 Lecture 22 Hash Tables, part 2 & Priority Queues, part 1 the single most important data structure known to mankind Hash Tables, Hash Functions,
More informationPreparation for OPNET Modeling
Part I Preparation for OPNET Modeling 1 Introduction This chapter introduces network modeling and simulation, and both OPNET and OPNET Modeler. If you already have relevant background, you can quickly
More informationSubject Name: System Modeling & Simulation. Prepared By : Ms. Pramela Devi( ASCP) Department : Computer Science & Engineering
Subject Name: System Modeling & Simulation Subject Code: 10CS82 Prepared By : Ms. Pramela Devi( ASCP) Department : Computer Science & Engineering Date : 12-02-2015 3/4/2015 UNIT 2 General Principles and
More informationIn 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 informationCS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 10: OCT. 6TH INSTRUCTOR: JIAYIN WANG
CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 10: OCT. 6TH INSTRUCTOR: JIAYIN WANG 1 Notice Assignments Reading Assignment: Chapter 3: Introduction to Parameters and Objects The Class 10 Exercise
More informationVariables and Functions. ROBOTC Software
Variables and Functions ROBOTC Software Variables A variable is a space in your robots memory where data can be stored, including whole numbers, decimal numbers, and words Variable names follow the same
More informationDiscrete-event simulation
1 SYSTEM MODELING AND SIMULATION UNIT-2 VIK UNIT 2 GENERAL PRINCIPLES, SIMULATION SOFTWARE: Concepts in Discrete-Event Simulation: The Event-Scheduling / Time-Advance Algorithm, World Views, Manual simulation
More informationScientific Computing
Scientific Computing Martin Lotz School of Mathematics The University of Manchester Lecture 1, September 22, 2014 Outline Course Overview Programming Basics The C++ Programming Language Outline Course
More informationQUIZ. What is wrong with this code that uses default arguments?
QUIZ What is wrong with this code that uses default arguments? Solution The value of the default argument should be placed in either declaration or definition, not both! QUIZ What is wrong with this code
More informationProgrammiersprachen (Programming Languages)
2016-05-13 Preface Programmiersprachen (Programming Languages) coordinates: lecturer: web: usable for: requirements: No. 185.208, VU, 3 ECTS Franz Puntigam http://www.complang.tuwien.ac.at/franz/ps.html
More informationCh. 10: Name Control
Ch. 10: Name Control Static elements from C The static keyword was overloaded in C before people knew what the term overload meant, and C++ has added yet another meaning. The underlying concept with all
More informationSECTION 5: STRUCTURED PROGRAMMING IN MATLAB. ENGR 112 Introduction to Engineering Computing
SECTION 5: STRUCTURED PROGRAMMING IN MATLAB ENGR 112 Introduction to Engineering Computing 2 Conditional Statements if statements if else statements Logical and relational operators switch case statements
More informationG Programming Languages - Fall 2012
G22.2110-003 Programming Languages - Fall 2012 Lecture 2 Thomas Wies New York University Review Last week Programming Languages Overview Syntax and Semantics Grammars and Regular Expressions High-level
More informationRecap: Pointers. int* int& *p &i &*&* ** * * * * IFMP 18, M. Schwerhoff
Recap: Pointers IFMP 18, M. Schwerhoff int* int& *p &i &*&* ** * * * * A 0 A 1 A 2 A 3 A 4 A 5 A 0 A 1 A 2 A 3 A 4 A 5 5 i int* p; A 0 A 1 A 2 A 3 A 4 A 5 5 i p int* p; p = &i; A 0 A 1 A 2 A 3 A 4 A 5
More informationSystem Design S.CS301
System Design S.CS301 (Autumn 2015/16) Page 1 Agenda Contents: Course overview Reading materials What is the MATLAB? MATLAB system History of MATLAB License of MATLAB Release history Syntax of MATLAB (Autumn
More informationCS 4349 Lecture September 13th, 2017
CS 4349 Lecture September 13th, 2017 Main topics for #lecture include #dynamic_programming, #Fibonacci_numbers, and #rod_cutting. Prelude Homework 2 due today in class. Homework 3 released, due next Wednesday
More informationSimulation Models for Manufacturing Systems
MFE4008 Manufacturing Systems Modelling and Control Models for Manufacturing Systems Dr Ing. Conrad Pace 1 Manufacturing System Models Models as any other model aim to achieve a platform for analysis and
More information3D Graphics Programming Mira Costa High School - Class Syllabus,
3D Graphics Programming Mira Costa High School - Class Syllabus, 2009-2010 INSTRUCTOR: Mr. M. Williams COURSE GOALS and OBJECTIVES: 1 Learn the fundamentals of the Java language including data types and
More informationObject Oriented Discrete-Event Simulation with OOSimL CS 4632
Object Oriented Discrete-Event Simulation with OOSimL CS 4632 Spring 2016 Dr. José M. Garrido Department of Computer Science College of Computing and Software Engineering Kennesaw State University Definitions
More information다중센서기반자율시스템의모델설계및개발 이제훈차장 The MathWorks, Inc. 2
1 다중센서기반자율시스템의모델설계및개발 이제훈차장 2017 The MathWorks, Inc. 2 What we will see today 3 Functional Segmentation of Autonomous System Aircraft/ Platform Sense Perceive Plan & Decide Control Connect/ Communicate
More informationG Programming Languages Spring 2010 Lecture 6. Robert Grimm, New York University
G22.2110-001 Programming Languages Spring 2010 Lecture 6 Robert Grimm, New York University 1 Review Last week Function Languages Lambda Calculus SCHEME review 2 Outline Promises, promises, promises Types,
More informationObject Oriented Programming
Binnur Kurt kurt@ce.itu.edu.tr Istanbul Technical University Computer Engineering Department 1 Version 0.1.2 About the Lecturer BSc İTÜ, Computer Engineering Department, 1995 MSc İTÜ, Computer Engineering
More informationIntroduction to Simulation
Introduction to Simulation Rosaldo Rossetti rossetti@fe.up.pt Http://www.fe.up.pt/~rossetti Assistant Professor at FEUP Faculty of Engineering of the University of Porto Researcher at LIACC Artificial
More informationChapter 3 General Principles. Banks, Carson, Nelson & Nicol Discrete-Event System Simulation
Chapter 3 General Principles Banks, Carson, Nelson & Nicol Discrete-Event System Simulation Purpose Develops a common framework for the modeling of complex systems. Covers the basic blocks for all discrete-event
More informationLECTURE 0: Introduction and Background
1 LECTURE 0: Introduction and Background September 10, 2012 1 Computational science The role of computational science has become increasingly significant during the last few decades. It has become the
More informationC++ Basics. Data Processing Course, I. Hrivnacova, IPN Orsay
C++ Basics Data Processing Course, I. Hrivnacova, IPN Orsay The First Program Comments Function main() Input and Output Namespaces Variables Fundamental Types Operators Control constructs 1 C++ Programming
More informationBlix the Programmer. An Introduction to Programming. 1.1 We program time. 1.2 First we need a tool
Blix the Programmer An Introduction to Programming 1.1 We program time So you are eager to learn programming, ok let s code a time machine! Imagine you are a programmer like Blix above. Our goal is to
More informationCS302 Topic: Simulation, Part II
CS302 Topic: Simulation, Part II Thursday, Oct. 6, 200 Gone out Here is a computer simulation of your dinner Announcements Lab 4 (Stock Reports); due this Friday, Oct. Lab (Algorithm Analysis) now available;
More informationExperiment 6 SIMULINK
Experiment 6 SIMULINK Simulink Introduction to simulink SIMULINK is an interactive environment for modeling, analyzing, and simulating a wide variety of dynamic systems. SIMULINK provides a graphical user
More informationTopic 2. Collections
Topic 2 Collections Objectives Define the concepts and terminology related to collections Discuss the abstract design of collections 2-2 Collections Collection: a group of items that we wish to treat as
More informationSTUDENT LESSON A17 Quadratic Sorting Algorithms
STUDENT LESSON A17 Quadratic Sorting Algorithms Java Curriculum for AP Computer Science, Student Lesson A17 1 STUDENT LESSON A17 Quadratic Sorting Algorithms INTRODUCTION: In this lesson, you will learn
More information6. Pointers, Structs, and Arrays. 1. Juli 2011
1. Juli 2011 Einführung in die Programmierung Introduction to C/C++, Tobias Weinzierl page 1 of 50 Outline Recapitulation Pointers Dynamic Memory Allocation Structs Arrays Bubble Sort Strings Einführung
More informationSTUDY NOTES UNIT 1 - INTRODUCTION TO OBJECT ORIENTED PROGRAMMING
OBJECT ORIENTED PROGRAMMING STUDY NOTES UNIT 1 - INTRODUCTION TO OBJECT ORIENTED PROGRAMMING 1. Object Oriented Programming Paradigms 2. Comparison of Programming Paradigms 3. Basic Object Oriented Programming
More information1. Describe History of C++? 2. What is Dev. C++? 3. Why Use Dev. C++ instead of C++ DOS IDE?
1. Describe History of C++? The C++ programming language has a history going back to 1979, when Bjarne Stroustrup was doing work for his Ph.D. thesis. One of the languages Stroustrup had the opportunity
More informationEvery language has its own scoping rules. For example, what is the scope of variable j in this Java program?
Lexical Binding There are two ways a variable can be used in a program: As a declaration As a "reference" or use of the variable Scheme has two kinds of variable "declarations" -- the bindings of a let-expression
More informationC++ Support Classes (Data and Variables)
C++ Support Classes (Data and Variables) School of Mathematics 2018 Today s lecture Topics: Computers and Programs; Syntax and Structure of a Program; Data and Variables; Aims: Understand the idea of programming
More informationIntroduction to Microchip-SIMULINK Blocksets and MATLAB Plug-in for MPLAB IDE
Introduction to Microchip-SIMULINK Blocksets and MATLAB Plug-in for MPLAB IDE Produced by Murali Manohara Chembarpu 2008 Microchip Technology Incorporated. All Rights Reserved. WebSeminar Title Slide 1
More informationCS1622. Semantic Analysis. The Compiler So Far. Lecture 15 Semantic Analysis. How to build symbol tables How to use them to find
CS1622 Lecture 15 Semantic Analysis CS 1622 Lecture 15 1 Semantic Analysis How to build symbol tables How to use them to find multiply-declared and undeclared variables. How to perform type checking CS
More informationBuilding IBIS-AMI Models for DDR5 Applications. Todd Westerhoff, SiSoft
Building IBIS-AMI Models for DDR5 Applications Todd Westerhoff, SiSoft SPEAKERS Image Todd Westerhoff VP, Semiconductor Relations, SiSoft twesterh@sisoft.com www.sisoft.com Todd has over 37 years of experience
More informationTypes and Type Inference
CS 242 2012 Types and Type Inference Notes modified from John Mitchell and Kathleen Fisher Reading: Concepts in Programming Languages, Revised Chapter 6 - handout on Web!! Outline General discussion of
More informationNumerical Methods in Scientific Computation
Numerical Methods in Scientific Computation Programming and Software Introduction to error analysis 1 Packages vs. Programming Packages MATLAB Excel Mathematica Maple Packages do the work for you Most
More informationGeneral Purpose Simulation System (GPSS) (Part 7)
General Purpose Simulation System (GPSS) (Part 7) Dr.Çağatay ÜNDEĞER Öğretim Görevlisi Bilkent Üniversitesi Bilgisayar Mühendisliği Bölümü e-mail : cagatay@undeger.com cagatay@cs.bilkent.edu.tr Bilgisayar
More informationSIMULATION OF A SINGLE-SERVER QUEUEING SYSTEM
SIMULATION OF A SINGLE-SERVER QUEUEING SYSTEM Will show how to simulate a specific version of the single-server queuing system Though simple, it contains many features found in all simulation models 1-
More informationCPE 101. Overview. Programming vs. Cooking. Key Definitions/Concepts B-1
CPE 101 Lecture 2: Problems, Algorithms, and Programs (Slides adapted from a UW course, copyrighted and used by permission) Overview High-level survey Problems, algorithms, and programs Problem solving
More informationProfessor Hugh C. Lauer CS-1004 Introduction to Programming for Non-Majors
First Python Program Professor Hugh C. Lauer CS-1004 Introduction to Programming for Non-Majors (Slides include materials from Python Programming: An Introduction to Computer Science, 2 nd edition, by
More informationChapter 9 Technicalities: Classes, etc. Walter C. Daugherity Lawrence Pete Petersen Bjarne Stroustrup Fall 2007
Chapter 9 Technicalities: Classes, etc. Walter C. Daugherity Lawrence Pete Petersen Bjarne Stroustrup Fall 2007 Abstract This lecture presents language technicalities, mostly related to user defined types;
More information6. Pointers, Structs, and Arrays. March 14 & 15, 2011
March 14 & 15, 2011 Einführung in die Programmierung Introduction to C/C++, Tobias Weinzierl page 1 of 47 Outline Recapitulation Pointers Dynamic Memory Allocation Structs Arrays Bubble Sort Strings Einführung
More informationCOMSC-051 Java Programming Part 1. Part-Time Instructor: Joenil Mistal
COMSC-051 Java Programming Part 1 Part-Time Instructor: Joenil Mistal Chapter 5 5 Controlling the Flow of Your Program Control structures allow a programmer to define how and when certain statements will
More informationPointers, Arrays and Parameters
Pointers, Arrays and Parameters This exercise is different from our usual exercises. You don t have so much a problem to solve by creating a program but rather some things to understand about the programming
More informationCSE 307: Principles of Programming Languages
1 / 26 CSE 307: Principles of Programming Languages Names, Scopes, and Bindings R. Sekar 2 / 26 Topics Bindings 1. Bindings Bindings: Names and Attributes Names are a fundamental abstraction in languages
More informationhw6, 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 informationCS102: 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 informationClasses and Methods לאוניד ברנבוים המחלקה למדעי המחשב אוניברסיטת בן-גוריון
Classes and Methods לאוניד ברנבוים המחלקה למדעי המחשב אוניברסיטת בן-גוריון 22 Roadmap Lectures 4 and 5 present two sides of OOP: Lecture 4 discusses the static, compile time representation of object-oriented
More informationCS558 Programming Languages
CS558 Programming Languages Winter 2017 Lecture 7b Andrew Tolmach Portland State University 1994-2017 Values and Types We divide the universe of values according to types A type is a set of values and
More information>>> Assignment #4 for Simulation (CAP 4800) <<<
>>> Assignment #4 for Simulation (CAP 4800) > SOLUTIONS
More informationChapter 9 Technicalities: Classes
Chapter 9 Technicalities: Classes Bjarne Stroustrup www.stroustrup.com/programming Abstract This lecture presents language technicalities, mostly related to user defined types; that is, classes and enumerations.
More informationInheritance: Develop solutions by abstracting real-world object and their interaction into code to develop software solutions. Layering: Organization
Final Exam Overview: Monday, 3pm-6pm, in WLH 2005 First pages: Quiz question - No quiz of week 2 - No bit manipulation (shifting and masking) - Quizzes: week 4, 6, 8, 10 One page on C++ language features
More informationMATLAB = MATrix LABoratory. Interactive system. Basic data element is an array that does not require dimensioning.
Introduction MATLAB = MATrix LABoratory Interactive system. Basic data element is an array that does not require dimensioning. Efficient computation of matrix and vector formulations (in terms of writing
More informationAssignment 2 in Simulation of Telesystems Laboratory exercise: Introduction to Simulink and Communications Blockset
Mid Sweden University Revised: 2013-11-12 Magnus Eriksson Assignment 2 in Simulation of Telesystems Laboratory exercise: Introduction to Simulink and Communications Blockset You are expected to conclude
More informationC++ For Science and Engineering Lecture 12
C++ For Science and Engineering Lecture 12 John Chrispell Tulane University Monday September 20, 2010 Comparing C-Style strings Note the following listing dosn t do what you probably think it does (assuming
More information8/16/12. Computer Organization. Architecture. Computer Organization. Computer Basics
Computer Organization Computer Basics TOPICS Computer Organization Data Representation Program Execution Computer Languages 1 2 Architecture Computer Organization n central-processing unit n performs the
More informationCOMPILER DESIGN LECTURE NOTES
COMPILER DESIGN LECTURE NOTES UNIT -1 1.1 OVERVIEW OF LANGUAGE PROCESSING SYSTEM 1.2 Preprocessor A preprocessor produce input to compilers. They may perform the following functions. 1. Macro processing:
More informationThursday, February 16, More C++ and root
More C++ and root Today s Lecture Series of topics from C++ Example of thinking though a problem Useful physics classes in ROOT Functions by this point you are used to the syntax of a function pass by
More informationPlan of the day. Today design of two types of container classes templates friend nested classes. BABAR C++ Course 103 Paul F. Kunz
Plan of the day Where are we at? session 1: basic language constructs session 2: pointers and functions session 3: basic class and operator overloading Today design of two types of container classes templates
More informationPage 1. Stuff. Last Time. Today. Safety-Critical Systems MISRA-C. Terminology. Interrupts Inline assembly Intrinsics
Stuff Last Time Homework due next week Lab due two weeks from today Questions? Interrupts Inline assembly Intrinsics Today Safety-Critical Systems MISRA-C Subset of C language for critical systems System
More informationCOMP 181. Agenda. Midterm topics. Today: type checking. Purpose of types. Type errors. Type checking
Agenda COMP 181 Type checking October 21, 2009 Next week OOPSLA: Object-oriented Programming Systems Languages and Applications One of the top PL conferences Monday (Oct 26 th ) In-class midterm Review
More information16. Linked Structures and Miscellaneous
16. Linked Structures and Miscellaneous The main purpose of this section is to look at the cool topic of linked data structures. This is where we use one object to point to the next object in a structure
More informationAustralian Nuclear Science & Technology Organisation. Upgrade of the ANTARES Computer Control System and our experience of EPICS.
Australian Nuclear Science & Technology Organisation Upgrade of the ANTARES Computer Control System and our experience of EPICS. Damien Lynch Why Upgrade? Remove reliance on old difficult to replace hardware
More informationT Hands-on 2. User-mode debuggers OllyDbg
T-110.6220 Hands-on 2 User-mode debuggers OllyDbg Disassemblers vs debuggers Static analysis / Disassemblers Theoretic approach Give us a static view of the binary Example: IDA Dynamic analysis / Debuggers
More informationSECTION 1: INTRODUCTION. ENGR 112 Introduction to Engineering Computing
SECTION 1: INTRODUCTION ENGR 112 Introduction to Engineering Computing 2 Course Overview What is Programming? 3 Programming The implementation of algorithms in a particular computer programming language
More informationa data type is Types
Pointers Class 2 a data type is Types Types a data type is a set of values a set of operations defined on those values in C++ (and most languages) there are two flavors of types primitive or fundamental
More informationNumerical approach estimate
Simulation Nature of simulation Numericalapproachfor investigating models of systems. Data are gathered to estimatethe true characteristics of the model. Garbage in garbage out! One of the techniques of
More informationARENA_Modules 7/28/98 page 1
ARENA_Modules 7/28/98 page 1 author This Hypercard stack was prepared by: Dennis L. Bricker, Dept. of Industrial Engineering, University of Iowa, Iowa City, Iowa 52242 e-mail: dennis-bricker@uiowa.edu
More informationSemantic Analysis and Type Checking
Semantic Analysis and Type Checking The compilation process is driven by the syntactic structure of the program as discovered by the parser Semantic routines: interpret meaning of the program based on
More informationClasses, Objects, and OOP in Java. June 16, 2017
Classes, Objects, and OOP in Java June 16, 2017 Which is a Class in the below code? Mario itsame = new Mario( Red Hat? ); A. Mario B. itsame C. new D. Red Hat? Whats the difference? int vs. Integer A.
More informationComp 151. Control structures.
Comp 151 Control structures. admin quiz this week believe it or not only 2 weeks from exam. one a week each week after that. idle debugger Debugger: program that will let you look at the program as it
More informationPage. No. 1/15 CS201 Introduction to Programmming Solved Subjective Questions From spring 2010 Final Term Papers By vuzs Team
Page. No. 1/15 CS201 Introduction to Programmming Solved Subjective Questions From spring 2010 Final Term Papers By vuzs Team Question No: 1 ( Marks: 2 ) Write a declaration statement for an array of 10
More informationAnnouncements Tues., Aug and 2. to call them ( ) ! For next time, read Learning Computing with Robots, chs.
Announcements Tues., Aug. 24! For next time, read Learning Computing with Robots, chs. 1 and 2.! The Blackboard site is up and operational!! not much content! mostly links back to my course homepage! Printed
More informationcs Java: lecture #6
cs3101-003 Java: lecture #6 news: homework #5 due today little quiz today it s the last class! please return any textbooks you borrowed from me today s topics: interfaces recursion data structures threads
More information1: Introduction to Object (1)
1: Introduction to Object (1) 김동원 2003.01.20 Overview (1) The progress of abstraction Smalltalk Class & Object Interface The hidden implementation Reusing the implementation Inheritance: Reusing the interface
More informationSemantic Analysis. Lecture 9. February 7, 2018
Semantic Analysis Lecture 9 February 7, 2018 Midterm 1 Compiler Stages 12 / 14 COOL Programming 10 / 12 Regular Languages 26 / 30 Context-free Languages 17 / 21 Parsing 20 / 23 Extra Credit 4 / 6 Average
More informationLEARNING TO PROGRAM WITH MATLAB. Building GUI Tools. Wiley. University of Notre Dame. Craig S. Lent Department of Electrical Engineering
LEARNING TO PROGRAM WITH MATLAB Building GUI Tools Craig S. Lent Department of Electrical Engineering University of Notre Dame Wiley Contents Preface ix I MATLAB Programming 1 1 Getting Started 3 1.1 Running
More informationTypes and Type Inference
Types and Type Inference Mooly Sagiv Slides by Kathleen Fisher and John Mitchell Reading: Concepts in Programming Languages, Revised Chapter 6 - handout on the course homepage Outline General discussion
More informationIntroduction to Computation and Problem Solving
Class 1: Introduction Introduction to Computation and Problem Solving Prof. Steven R. Lerman and Dr. V. Judson Harward Handouts for Today Course syllabus Academic Honesty Guidelines Laptop request form
More informationChapter 9 Technicalities: Classes, etc.
Chapter 9 Technicalities: Classes, etc. Dr. Hyunyoung Lee Based on slides by Dr. Bjarne Stroustrup www.stroustrup.com/programming Abstract This lecture presents language technicalities, mostly related
More informationPerformance Evaluation
Performance Evaluation Chapter 4 A Complicated Queuing System (Acknowledgement: These slides have been prepared by Prof. Dr. Holger Karl) 1 Goal of this chapter! Understand implementation issues and solutions
More informationBorland 105, 278, 361, 1135 Bounded array Branch instruction 7 break statement 170 BTree 873 Building a project 117 Built in data types 126
INDEX = (assignment operator) 130, 816 = 0 (as function definition) 827 == (equality test operator) 146! (logical NOT operator) 159!= (inequality test operator) 146 #define 140, 158 #include 100, 112,
More informationCMSC 201 Spring 2019 Lab 06 Lists
CMSC 201 Spring 2019 Lab 06 Lists Assignment: Lab 06 Lists Due Date: Thursday, March 7th by 11:59:59 PM Value: 10 points This week s lab will put into practice the concepts you learned about lists: indexing,
More information