Upload
loki
View
44
Download
2
Embed Size (px)
DESCRIPTION
The view from here…. Grutors available Tues. night in the LAC. Hw #11 due Tuesday. 11/30. 12/2. 12/7. "TheoComp". un computability. Exam #2 returned. computational models. Sun., 12/6 – Interim milestones due. 12/9 - final CS 5 class meeting. Extra-credit labs ~ circuits. - PowerPoint PPT Presentation
Citation preview
Sun., 12/6 – Interim milestones due
The view from here…
11/30 12/2 12/7
computational modelsuncomputability
"TheoComp"
Fri., 12/11 – Final projects due
Thu., 12/17 2pm – Exam option #1
12/9 - final CS 5 class meeting
Fri., 12/18 2pm – Exam option #2
Exam #2 returned
Extra-credit labs ~ circuits
Sign up
• Tuesday, 11/24 @ 10pm
• Wednesday, 11/25 @ 1:15pm
2 labs, 25 points each
Hw #11 due Tuesday Grutors available Tues. night in the LAC.
• All about the CS 5 Term Projects• Looking ahead to today's lab• A sneak peek at "December in CS 5"
CS 5 today…
pyRobotText Clouds
vPoolPicobot
I’ve got my eyes on some of these projects!
Eye'll bet!
if time…
Final projects
Final CS assignment
open-ended
comprehensive
Working solo or duo is OK
same projects for black/gold
Pairs need to share the work equally and together
several choices…
Eye, eye!
Hey! Watch where you're going!
The pyRobot project
Goal: get from Pt A to Pt B2d Roomba simulator
How do I control this robot !?!
Pt B
Pt A
The pyRobot project
Robot control continuously runs three things:
SENSE
[x,y,thd], bump = self.getData()
while True:
The pyRobot project
Robot control continuously runs three things:
SENSE PLAN
[x,y,thd], bump = self.getData()
if bump[0] == True or bump[1] == True: print 'BUMP!', print ' [Left bump sensor:', bump[0], '] ', print ' [Right bump sensor:', bump[1], '] ' robotTask = STOP
STOP is one of the robot's states. Every 40th of a second, the robot runs through this loop, sets the robot's state and sets the velocities accordingly. Don't sleep!
while True:
The pyRobot project
Robot control continuously runs three things:
SENSE PLAN ACT
[x,y,thd], bump = self.getData()
if bump[0] == True or bump[1] == True: print 'BUMP!', print ' [Left bump sensor:', bump[0], '] ', print ' [Right bump sensor:', bump[1], '] ' robotTask = STOP
STOP is one of the robot's states. Every 40th of a second, the robot runs through this loop, sets the robot's state and sets the velocities accordingly. Don't sleep!
if robotTask == STOP: self.setVels(0,0) robotTask = KBD
while True:
Maps are set at the very bottom of the main.py file:
Required
Extra
PicoRoomba!
The pyRobot project ~ additions
Goal: get from Pt A to Pt B
Start in an unknown location on the map…
Optional
Use only the bump sensors… (no range sensing)
Implement a niftier interface…
Use noisy (realistic) data
Main
vPython Roomba?
ASCII Roomba?
PicoRoomba!
The pyRobot project ~ additions
Goal: get from Pt A to Pt B
Start in an unknown location on the map…
vPython Roomba?
ASCII Roomba?Use only the bump sensors… (no range sensing)
Implement a niftier interface…
Try it out on a Roomba…
Use noisy (realistic) data
Optional
Main
Let’s play!
I’ll take your cue.
3d simulator, VPython
The vPool project
The vPool project
VPython?Easily installable for windows…
Also installable on the Mac…- it is on the Macs in the CS lab…
A simple example:
from visual import *
c = cylinder()What's visual?What's c?
at least it's not Visual C…
www.vpython.org
- Not really installable under Linux
The vPool project
from visual import *
floor = box( pos=(0,0,0), length=4, height=0.5, width=4, color=color.blue)
ball = sphere( pos=(0,4,0), radius=1, color=color.red)
ball.velocity = vector(0,-1,0)dt = 0.01
while True: rate(100) ball.pos = ball.pos + ball.velocity*dt
if ball.y < ball.radius: ball.velocity.y = -ball.velocity.y else: ball.velocity.y = ball.velocity.y - 9.8*dt
How many classes?How many objects?
data members?
What's the if/else
doing?
The vPool project
Phunky Fisicks is welcome!
Collisions with walls?
Collisions with other pool balls?
Pockets?
A few examples to get you thinking…
Linux users are welcome! But they should use another OS…
Picobot returns!
Picobot is a finite-state machine!
Basic idea: implement Picobot (the homework problem from Week 1)
Requirements:
The Picobot project
Text and graphical outputRead Picobot program from a fileRead maze description from a fileTrack visited/unvisited squaresProhibit illegal moves
Current State: 1Current Rule: 1 N*W* -> X 2
+++++++++++o++o+o++++oooooo ++++++o++ ++oooo+++++++++o ++oooo+++ +++++o++++++Rooo +++++++++++
The Picobot project
First, prototype it as ASCII-bot
Picobot started here…
and is now here…
• Text and graphical output• Read Picobot program from a file• Read maze description from a file• Track visited/unvisited squares• Prohibit illegal moves• Stop when maze completely visited
The Picobot project
Required capabilities:
The Picobot project
• Choice of graphical packages • vpython• turtle• csplot/csgrid (Game-of-Life)
• Start/stop/step feature• Maze editing• Pebble dropping• Be inventive!
csplot or csgrid version…Graphical picobot:
Lots of options…
Hey! Picobot in 3d…
Mine's going to be in 5d!
The Picobot project
Text Clouds project
tag cloud
Text Clouds project
text cloud
Summary of the words in a body of text, sized and painted according to their frequency.
this doesn't look nearly colorful enough…
Text Clouds project
From text…
… to cloud
1. Start with entered webpage (URL)
2. Read in text
3. Create list of words out of text
4. "Clean" the words
5. "Stem" the words
6. Count the words
7. Return a string with frequencies
8. Add advanced features…
Huh?
Text Clouds project
http://www.cs.hmc.edu/~cs5grad/cs5/textcloud/page1.html
Spamming spammers spammed spam. Spam spam spam! I love spam!
['spamming', 'spammers', spammed', 'spam.', 'spam', 'spam', 'spam!','I', 'love', 'spam!', 'page', '2']
Page 2
Text Clouds project
http://www.cs.hmc.edu/~cs5grad/cs5/textcloud/page1.html
Spamming spammers spammed spam. Spam spam spam! I love spam!
['spamming', 'spammers', spammed', 'spam', 'spam', 'spam', 'spam','love', 'spam', 'page', '2']
['spamming', 'spammers', spammed', 'spam.', 'spam', 'spam', 'spam!','I', 'love', 'spam!', 'page', '2']
Page 2
What changed here?
Text Clouds project
http://www.cs.hmc.edu/~cs5grad/cs5/textcloud/page1.html
Spamming spammers spammed spam. Spam spam spam! I love spam!
['spamming', 'spammers', spammed', 'spam', 'spam', 'spam', 'spam','love', 'spam', 'page', '2']
['spamming', 'spammers', spammed', 'spam.', 'spam', 'spam', 'spam!','I', 'love', 'spam!', 'page', '2']
['spam', 'spam', spam', 'spam', 'spam', 'spam', 'spam','love', 'spam', 'page', '2']
Page 2
What changed here?
What next?
Text Clouds project
Suggested Approach: Develop the basic application the usual way, using IDLE.
• Once you have everything working, transfer your files to your webspace. set up the HTML wrapper files & go…
Hypertext Markup Language
• Use the provided code to read HTML
• Personalize - There are lots of ways to do this!
• Once you have things working, move on to writing HTMLfollowing links beyond depth 1avoiding repeated links!
• Make sure that you can process the files appropriately into ordered lists of words…
Text-cloud historyhttp://chir.ag/phernalia/preztags/
What’s due?
Sun., 12/6 – Interim milestones due (11:59 pm)
milestone.txt milestone.py
Nice milestone!
It’s actually a kilometer stone.
– Name(s)– Project chosen– Your project description:What is your plan.What is your approach.A start at an implementation.
– Classes and functions– Docstrings– 60-80+ lines of working,
tested code
What’s due?
A final milestone?
Fri., 12/11 – Final deliverables due (by 5:00 pm)
final.txt final.py– Name(s)– Project chosen– Description of user interface:How do we run / play your project.What features did you implement.What was your approach & plan.
– Classes and functions with documentation/docstrings
– Working, tested code
CS 5 currency…
Final project: 1 Euro for each deadline
BOTH partners must have a Euro left.
Ask Prof. Kuenning about his Euro "buy-back" plan!
Later Labs…
December's labs are final-project based:
• optional, but helpful!
• a natural opportunity to work in a pair
• work on your laptop or the CS machines
• easy access to help
• unspeakably fun!
and some of the CS machines do need
work!
• HTML set up for the TextClouds project
Don't say it!
Lab today: User interfaces
No undo?
% ls
file1.txt file2.txt
file3.txt !
% rm *!
(long pause…)
The command-line
Command-line commands
Hey - that's me!
pwd
ls
cd
nano
cp
chmod
wc
prints the current directory
lists the current directory
changes directory
edits files
copies files
changes file permissions
counts the words, lines, and characters
Design for software and beyond
0. Conceptual models
1. Mapping
2. Visibility
3. Feedback
4. Affordances
Don Norman's key principles:
Where do these go wrong?Mapping
How to open this gas cap?
Visibility Feedback Affordances
This handle unfastens the seat from the floor. How to turn on this stove?
Set to 5 minutes?
Win NT Dialog