Skip to content
Snippets Groups Projects
Commit 11ff5e34 authored by W. Spencer Smith's avatar W. Spencer Smith
Browse files

Updates to L18, very preliminary L19

parent 6b35fe8a
No related branches found
No related tags found
No related merge requests found
Showing with 860 additions and 161 deletions
No preview for this file type
%\documentclass[13pt]{beamer} % some colour, looks good with logictheme style %\documentclass[t,12pt,numbers,fleqn,handout]{beamer}
\documentclass[handout]{beamer} % for handout \documentclass[t,12pt,numbers,fleqn]{beamer}
%\documentclass{beamer} % for slides using uncover
\usepackage{logictheme} \usepackage{pgfpages}
\usepackage{amsmath}
\usepackage{bm}
\usepackage{ulem}
\usepackage{hhline}
\usepackage{multirow}
\usepackage{multicol}
\usepackage{array}
\usepackage{hyperref} \usepackage{hyperref}
\hypersetup{colorlinks=true,
linkcolor=blue,
citecolor=blue,
filecolor=blue,
urlcolor=blue,
unicode=false}
\urlstyle{same}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{listings} \useoutertheme{split} %so the footline can be seen, without needing pgfpages
\title[Maze Tracing Robot (slide \thepage)]{Maze Tracing Robot Example} % \pgfpagesuselayout{resize to}[letterpaper,border
%\subtitle{???} % shrink=5mm,landscape] %if this is uncommented, the hyperref links do not work
\author[Smith]{Dr.~Spencer Smith}
\institute{Computing and Software Department, McMaster University}
\date{\today}
\pgfdeclareimage[height=0.5cm]{logo}{../McMasterLogo} %McMaster logo in one folder up
\logo{\pgfuseimage{logo}}
\setbeamercolor{alerted text}{fg=red!75!green!50!blue} \mode<presentation>{}
%\setbeamerfont{alerted text}{series=\bfseries}
\setbeamerfont{alerted text}{family=\rmfamily,series=\bfseries}
%\setbeamertemplate{footline}{\insertpagenumber} % only has the page number \input{../def-beamer}
\newcounter{temp} \newcommand{\topic}{18 Maze Tracing Robot Example}
\input{../titlepage}
\begin{document} \begin{document}
% ================================================================================== \input{../footline}
% Slide 1
\maketitle %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ==================================================================================
\begin{frame} \begin{frame}
\frametitle{Maze Tracing Robot Example} \frametitle{Maze Tracing Robot Example}
\begin{itemize} \begin{itemize}
\item Administrative details \item Administrative details
\item Dr.\ v.\ Mohrenschildt's maze tracing robot (see WebCT document) \item Index set example
\item Solar water heating tank example
\item Dr.\ v.\ Mohrenschildt's maze tracing robot (see GitLab)
\item MIS for maze\_storage \item MIS for maze\_storage
\end{itemize} \end{itemize}
\end{frame} \end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame} \begin{frame}
\frametitle{Administrative Details} \frametitle{Administrative Details}
\begin{itemize} \begin{itemize}
\item Assignment 3 deadlines \item Assignment 2
\begin{itemize} \begin{itemize}
\item Minor modifications to posted file \item {Files due by 11:59 pm Feb 19}
\item Code due by midnight Feb 23 \item {File automatically sent to partners on Feb 20}
\item E-mail your partner your code by Feb 24 \item Lab report due by 11:59 pm Feb 27
\item Lab report due by the beginning of class Mar 2 \item {When returning an object, you can either create a new object or
\item Will discuss Assignment 3 during tutorial, time for questions return a reference}
\item {Remember: Deque is an Abstract Object, not an ADT}
\end{itemize} \end{itemize}
\item Midterm exam \item Midterm exam
\begin{itemize} \begin{itemize}
\item March 4 during tutorial time \item March 1, 7:00 pm, TSH/120
\item In T29/105, not our usual classroom \item 90 minute duration
\item Multiple choice - 30--40 questions?
\item Open book (any paper)
\end{itemize} \end{itemize}
\end{itemize} \end{itemize}
\end{frame} \end{frame}
...@@ -75,170 +78,151 @@ ...@@ -75,170 +78,151 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame} \begin{frame}
\frametitle{Modules with External Interaction} \frametitle{Index Set}
\begin{itemize} Write a function \texttt{indexSet(x, B)} that takes a value \texttt{x} and a
\item In general, some modules may interact with the environment or other modules list of values \texttt{B} and returns a list of indices where \texttt{B[i] =
%\item The Display Point Masses Applet module does this x}.\\
\item Environment might include the keyboard, the screen, the file system, motors, sensors, etc. ~\newline
\item Sometimes the interaction is informally specified using prose (natural language) As a first step, how would you say this mathematically?
\item Can introduce an environment variable
\begin{itemize}
\item Name, type
\item Interpretation
\end{itemize}
\item Environment variables include the screen, the state of a motor (on, direction of rotation, power level, etc.),
the position of a robot
\end{itemize}
\end{frame} \end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame} \begin{frame}
\frametitle{External Interaction Continued} \frametitle{Index Set}
\begin{itemize} Write a function \texttt{indexSet(x, B)} that takes a value \texttt{x} and a
\item Some external interactions are hidden list of values \texttt{B} and returns a list of indices where \texttt{B[i] =
\begin{itemize} x}.\\
\item Present in the implementation, but not in the MIS
\item An example might be OS memory allocation calls $$\mbox{indexSet}(x, B) \equiv \{i : \mathbb{N} | i \in [0 .. |B|-1] \wedge B_i =
\end{itemize} x : i\}$$
\item External interaction described in the MIS
\begin{itemize} How could you use \texttt{indexSet} to calculate \texttt{rank(x, A)}?
\item Naming access programs of the other modules
\item Specifying how the other module's state variables are changed
\item The MIS should identify what external modules are used
\end{itemize}
\end{itemize}
\end{frame} \end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{MIS for GUI Modules}
\begin{itemize} \begin{frame}
\item Could introduce an environment variable \frametitle{Anticipated Changes}
\item window: sequence [RES\_H][RES\_V] of pixelT
\begin{itemize} \bi
\item Where window[r][c] is the pixel located at row r and column c, with numbering zero-relative and beginning at the \item The specific hardware on which the software is to run
upper left corner \item The format of the initial input data
\item Would still need to define pixelT \item The format of the input parameters
\end{itemize} \item The constraints on the input parameters
\item Could formally specify the environment variable transitions \item The format of the output data
\item More often it is reasonable to specify the transition in prose \item The constraints on the output results
\item In some cases the proposed GUI might be shown by rough sketches \item How the governing ODEs are defined using the input parameters
\end{itemize} \item How the energy equations are defined using the input parameters
\item How the overall control of the calculations is orchestrated
\item The implementation of the sequence data structure
\item The algorithm used for the ODE solver
\item The implementation of plotting data
\ei
\end{frame} \end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame} \begin{frame}
\frametitle{Display Point Masses Module Syntax} \frametitle{Module Hierarchy by Secrets}
\begin{table}[h!]
\centering
\begin{tabular}{p{0.3\textwidth} p{0.6\textwidth}}
\toprule
\textbf{Level 1} & \textbf{Level 2}\\
\midrule
{Hardware-Hiding Module} & ~ \\
\midrule
\multirow{6}{0.3\textwidth}{Behaviour-Hiding Module} & Input Format Module\\
& Input Parameters Module\\
& Output Format Module\\
& Temperature ODEs Module\\
& Energy Equations Module\\
& Control Module\\
\midrule
\multirow{3}{0.3\textwidth}{Software Decision Module} & {Sequence Data Structure Module}\\
& ODE Solver Module\\
& Plotting Module\\
\bottomrule
\textbf{Exported Access Programs}\\
~\newline
\begin{tabular}{| l | l | l | l |}
\hline
\textbf{Routine name} & \textbf{In} & \textbf{Out} & \textbf{Exc.}\\
\hline
DisplayPointMassesApplet & ~ & DisplayPointMassesApplet & ~\\
\hline
paint & ~ & ~ & ~\\
\hline
\end{tabular} \end{tabular}
\caption{Module Hierarchy}
\label{TblMH}
\end{table}
\end{frame} \end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame} \begin{frame}
\frametitle{Display Point Masses Module Semantics} \frametitle{Example Modules from SWHS}
\textbf{Environment Variables}\\ \textbf{Hardware Hiding Modules}
$\mathit{win}:$ 2D sequence of pixels displayed within a web-browser \\
\noindent DisplayPointMassesApplet(): \begin{description}
\begin{itemize} \item[Secrets:]The data structure and algorithm used to implement the virtual
\item transition: The state of the abstract object ListPointMasses is modified as follows:\\ hardware.
ListPointMasses.init()\\ \item[Services:]Serves as a virtual hardware used by the rest of the
ListPointMasses.add(0, PointMassT(20, 20, 10)\\ system. This module provides the interface between the hardware and the
ListPointMasses.add(1, PointMassT(120, 200, 20)\\ software. So, the system can use it to display outputs or to accept inputs.
... \item[Implemented By:] OS
\end{itemize} \end{description}
\noindent paint():
\begin{itemize}
\item transition $win := $ Modify window so that the point masses in ListPointMasses
are plotted as circles. The centre of each circles should be the corresponding x and y coordinates and the radius should
be the mass of the point mass.
\end{itemize}
\end{frame} \end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame} \begin{frame}
\frametitle{Assignment 3 Vector Module} \frametitle{Example Modules from SWHS}
\textbf {Exported Access Programs}\\ \textbf{Input Verification Module}
~\newline
\begin{tabular}{| l | l | l | p{0.75in} |} \begin{description}
\hline \item[Secrets:] The rules for the physical and software constraints.
\textbf{Routine name} & \textbf{In} & \textbf{Out} & \textbf{Exceptions}\\ \item[Services:] Verifies that the input parameters comply with physical and
\hline software constraints. Throws an error if a parameter violates a physical
new vectorT & real $\rightarrow$ real & vectorT & ~\\ constraint. Throws a warning if a parameter violates a software constraint.
\hline \item[Implemented By:] SWHS
getf & ~ & real $\rightarrow$ real & ~\\ \end{description}
\hline
eval & real, real, integer & sequence of real & deltaNeg, nstepsNeg\\
\hline
evalPrint & real, real, integer & ~ & deltaNeg, nstepsNeg\\
\hline
\end{tabular}
\end{frame} \end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame} \begin{frame}
\frametitle{Vector Module Semantics} \frametitle{Example Modules from SWHS}
\textbf{Environment Variables}\\ \textbf{ODE Solver Module}
$\mathit{screen}$ : two dimensional sequence of positions on the screen, which each position holding a character\\
~\newline \begin{description}
\textbf{State Variables}\\ \item[Secrets:] The algorithm to solve a system of first order ODEs.
$f$: real $\rightarrow$ real\\ \item[Services:] Provides solvers that take the governing equation, initial
~\newline conditions, and numerical parameters, and solve them.
\textbf{Access Routine Semantics}\\ \item[Implemented By:] Matlab
\noindent eval ($\mathit{startx}, \mathit{deltax}, \mathit{nsteps}$): \end{description}
\begin{itemize}
\item output: $out := < f(\mathit{startx}), f(\mathit{startx} + \mathit{deltax}), f(\mathit{startx} + 2 \cdot \mathit{deltax}), ...
, f(\mathit{startx} + \mathit{nsteps} \cdot \mathit{deltax})>$
\item exception: $exc := ((\mathit{deltax} < 0) \Rightarrow \mbox{deltaNeg} | (\mathit{nsteps} < 0) \Rightarrow
\mbox{nstepsNeg})$
\end{itemize}
\end{frame} \end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame} \begin{frame}[plain, fragile]
\frametitle{Vector Module Semantics Continued}
\noindent evalPrint ($\mathit{startx}, \mathit{deltax}, \mathit{nsteps}$): \frametitle{SWHS Uses Hierarchy}
\begin{itemize}
\item transition: The state of $\mathit{screen}$ is modified so that the sequence returned by eval ($\mathit{startx}$, \begin{center}
$\mathit{deltax}$, $\mathit{nsteps}$) is displayed. \includegraphics[scale=0.55]{UsesHierarchy.pdf}
\item exception: $exc := ((\mathit{deltax} < 0) \Rightarrow \mbox{deltaNeg} | (\mathit{nsteps} < 0) \Rightarrow \end{center}
\mbox{nstepsNeg})$
\end{itemize}
\end{frame} \end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame} \begin{frame}
\frametitle{Dr.\ v.\ Mohrenschildt's Maze Tracing Robot Example} \frametitle{Dr.\ v.\ Mohrenschildt's Maze Tracing Robot Example}
...@@ -254,7 +238,8 @@ $\mathit{deltax}$, $\mathit{nsteps}$) is displayed. ...@@ -254,7 +238,8 @@ $\mathit{deltax}$, $\mathit{nsteps}$) is displayed.
\frametitle{Maze Tracing Robot Expected Changes} \frametitle{Maze Tracing Robot Expected Changes}
\begin{itemize} \begin{itemize}
\item Changes to the geometry of the robot such that the mapping from a position to the robot inputs is different \item Changes to the geometry of the robot such that the mapping from a position
to the robot inputs is different
\item Changes to the interface to the robot \item Changes to the interface to the robot
\item Changes to the format of the maze \item Changes to the format of the maze
\item Changes to any constant values \item Changes to any constant values
...@@ -306,20 +291,23 @@ $\mathit{deltax}$, $\mathit{nsteps}$) is displayed. ...@@ -306,20 +291,23 @@ $\mathit{deltax}$, $\mathit{nsteps}$) is displayed.
\begin{itemize} \begin{itemize}
\item \structure<1>{Module name:} control \item \structure<1>{Module name:} control
\begin{itemize} \begin{itemize}
\item \structure<1>{Secret:} how the arm moves from position to position and how the buttons are checked \item \structure<1>{Secret:} how the arm moves from position to position and how
the buttons are checked
\item \structure<1>{Service:} controls the movement of the arm \item \structure<1>{Service:} controls the movement of the arm
\item \structure<1>{Module prefix:} cn\_ \item \structure<1>{Module prefix:} cn\_
\end{itemize} \end{itemize}
\item \structure<1>{Module name:} geometry \item \structure<1>{Module name:} geometry
\begin{itemize} \begin{itemize}
\item \structure<1>{Secret:} how the calculations from cell coords to robot coords are performed \item \structure<1>{Secret:} how the calculations from cell coords to robot
coords are performed
\item \structure<1>{Service:} handles geometric positioning of the arm \item \structure<1>{Service:} handles geometric positioning of the arm
\item \structure<1>{Module prefix:} gm\_ \item \structure<1>{Module prefix:} gm\_
\end{itemize} \end{itemize}
\item \structure<1>{Module name:} hardware \item \structure<1>{Module name:} hardware
\begin{itemize} \begin{itemize}
\item \structure<1>{Secret:} how it interfaces with the robot \item \structure<1>{Secret:} how it interfaces with the robot
\item \structure<1>{Service:} handles hardware aspects of arm (movement and button checking) \item \structure<1>{Service:} handles hardware aspects of arm (movement and
button checking)
\item \structure<1>{Module prefix:} hw\_ \item \structure<1>{Module prefix:} hw\_
\end{itemize} \end{itemize}
\end{itemize} \end{itemize}
...@@ -332,8 +320,10 @@ $\mathit{deltax}$, $\mathit{nsteps}$) is displayed. ...@@ -332,8 +320,10 @@ $\mathit{deltax}$, $\mathit{nsteps}$) is displayed.
\begin{itemize} \begin{itemize}
\item \structure<1>{Module name:} types\_constants \item \structure<1>{Module name:} types\_constants
\begin{itemize} \begin{itemize}
\item \structure<1>{Secret:} how the data structures are defined and constants defined \item \structure<1>{Secret:} how the data structures are defined and constants
\item \structure<1>{Service:} provides standard variable types and constants to modules defined
\item \structure<1>{Service:} provides standard variable types and constants to
modules
\end{itemize} \end{itemize}
\end{itemize} \end{itemize}
\end{frame} \end{frame}
...@@ -410,8 +400,8 @@ cell = tuple of (x: integer, y: integer) ...@@ -410,8 +400,8 @@ cell = tuple of (x: integer, y: integer)
% there could be one related to maximum size of the map % there could be one related to maximum size of the map
~\newline ~\newline
\textbf{Assumptions}\\ \textbf{Assumptions}\\
~\newline ~\newline ms\_get\_maze\_start and ms\_get\_maze\_end are not called until after
ms\_get\_maze\_start and ms\_get\_maze\_end are not called until after the corresponding set routines have been called. the corresponding set routines have been called.
\end{frame} \end{frame}
...@@ -520,7 +510,6 @@ ms\_get\_maze\_start and ms\_get\_maze\_end are not called until after the corre ...@@ -520,7 +510,6 @@ ms\_get\_maze\_start and ms\_get\_maze\_end are not called until after the corre
\frametitle{Additional Specifications for Determining the Path} \frametitle{Additional Specifications for Determining the Path}
pathT = sequence of cell\\ pathT = sequence of cell\\
~\newline
\noindent validPath : pathT $\rightarrow$ boolean \noindent validPath : pathT $\rightarrow$ boolean
\begin{itemize} \begin{itemize}
......
File added
File added
File added
This diff is collapsed.
File added
File added
File added
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment