Difference between revisions of "CSC111 Homework 11"

From dftwiki3
Jump to: navigation, search
(Bubbles, bubbles, bubbles)
(Something fun and unrelated)
 
(12 intermediate revisions by the same user not shown)
Line 6: Line 6:
 
<br />
 
<br />
 
<br />
 
<br />
This homework assignment is due next Thursday, at midnight.  It deals with Object Oriented Programming, classes, and objects.
+
This homework assignment is due next Thursday, at midnight.  It deals with Object Oriented Programming, classes, and objects.  The optional part deals classes containing lists of objects.
 
<br />
 
<br />
 
<br />
 
<br />
Line 15: Line 15:
 
==Bubbles, bubbles, bubbles==
 
==Bubbles, bubbles, bubbles==
  
* Write a program that is called hw11a.py, that is the continuation of [[CSC111 Lab 11|Lab 11]].
+
* Write a program that is called '''hw11a.py''', that is the continuation of [[CSC111 Lab 11|Lab 11]].
  
 
* Your program should have a class for a fish, as you did in Lab 11.
 
* Your program should have a class for a fish, as you did in Lab 11.
Line 23: Line 23:
 
* As fish move around they  generate bubbles through their mouth.  In other words, bubble will appear randomly and when they do, their center should be the mouth of the fish (or close to it).  Then, as the simulation goes on, the fish moves slowly forward, and the bubble moves slowly upward.
 
* As fish move around they  generate bubbles through their mouth.  In other words, bubble will appear randomly and when they do, their center should be the mouth of the fish (or close to it).  Then, as the simulation goes on, the fish moves slowly forward, and the bubble moves slowly upward.
  
* When a fish disappear from the tank, because it moves out, it should reappear on the other side of the tank.  Make sure this operation is life-like, i.e. we want to see the nose of the fish appear, then its head, then its body, then it's fully on the graphics window.
+
* When a fish disappears from the tank, because it moves out, it should reappear on the other side of the tank.  Make sure this operation is life-like, i.e. we want to see the nose of the fish appear, then its head, then its body, then it's fully on the graphics window.
  
* When a bubble disappear from the tank, it is removed from the simulation.  You will very likely use a list to keep track of the bubbles, and as a bubble leaves the tank completely, it should be removed from the list.
+
* When a bubble disappears from the tank, it is removed from the simulation.  You will very likely use a list to keep track of the bubbles, and as a bubble leaves the tank completely, it should be removed from the list.
  
 
==Optional and Extra-Credit==
 
==Optional and Extra-Credit==
Line 35: Line 35:
 
** The School class contains a method that runs the simulation, moving all the fish and the bubble around.
 
** The School class contains a method that runs the simulation, moving all the fish and the bubble around.
  
* If you do this program, call it hw11b.py.
+
* If you do this program, call it '''hw11b.py'''.
  
 
==Submission==
 
==Submission==
  
   submit hw11a.py
+
   submit hw11 hw11a.py
  
 
and/or
 
and/or
  
   submit hw11b.py            ''(if you have done the extra credit question)''
+
   submit hw11 hw11b.py            ''(if you have done the extra credit question)''
 +
 
 +
==Something fun and unrelated==
 +
 
 +
; Monitoring a Cluster of Computers as a school of fish (U. Nebraska). 
 +
:In this video, the researchers at U. of Nebraska decided to use fish swiming in a tank as a way of displaying some properties of  a cluster of many computers working together on some large problem.  All the computers are involved in a common computation.  Each fish (as far as we can tell, given the lack of better information) represents a computer or a program running on a computer.  As the user interacting with the visualization zooms in on a fish, a blue window pops up to give some vital information about the computer or program represented by the fish.  Fish change color and size to indicate that some important parameter is changing.  One could imaging that green fish represent computers not doing much work, while orange fish represent computers loaded with work.  It is interesting to see how researchers would use a school of fish as a way to help humans better understand what is going with some complex computation taking place on a cluster of computers.  The researchers are relying on human beings's ability to easily pick up visual clues to understand how a large number of systems are operating together.  This is certainly better than trying to have the same human beings read tons of log files containing the date and time of many different events occurring in the cluster.
 +
<br /><br /><center><videoflash>LM1j_8sWSEk</videoflash></center><br /><br />
 +
 
 +
<br />
 +
<br />
 +
<br />
 +
<br />
 +
<br />
 +
<br />
 +
<br />
 +
<br />
 +
<br />
 +
<br />
 +
<br />
 +
[[Category:CSC111]][[Category:Homework]][[Category:Python]]

Latest revision as of 08:08, 21 April 2010



This homework assignment is due next Thursday, at midnight. It deals with Object Oriented Programming, classes, and objects. The optional part deals classes containing lists of objects.

Bubbles, bubbles, bubbles

  • Write a program that is called hw11a.py, that is the continuation of Lab 11.
  • Your program should have a class for a fish, as you did in Lab 11.
  • In the new program you need implement a new type of object which represents bubbles. A bubble is an object for which you have to declare a new class. One bubble = one object.
  • As fish move around they generate bubbles through their mouth. In other words, bubble will appear randomly and when they do, their center should be the mouth of the fish (or close to it). Then, as the simulation goes on, the fish moves slowly forward, and the bubble moves slowly upward.
  • When a fish disappears from the tank, because it moves out, it should reappear on the other side of the tank. Make sure this operation is life-like, i.e. we want to see the nose of the fish appear, then its head, then its body, then it's fully on the graphics window.
  • When a bubble disappears from the tank, it is removed from the simulation. You will very likely use a list to keep track of the bubbles, and as a bubble leaves the tank completely, it should be removed from the list.

Optional and Extra-Credit

  • Create a new class called School, which will contain the list of fish currently in the tank, and the list of bubbles.
  • You are free to decide how the simulation (main loop where the object moves) is implemented:
    • Either you create a function called by main() that contains a loop that moves the fish and the bubble, or
    • The School class contains a method that runs the simulation, moving all the fish and the bubble around.
  • If you do this program, call it hw11b.py.

Submission

 submit hw11 hw11a.py

and/or

 submit hw11 hw11b.py            (if you have done the extra credit question)

Something fun and unrelated

Monitoring a Cluster of Computers as a school of fish (U. Nebraska).
In this video, the researchers at U. of Nebraska decided to use fish swiming in a tank as a way of displaying some properties of a cluster of many computers working together on some large problem. All the computers are involved in a common computation. Each fish (as far as we can tell, given the lack of better information) represents a computer or a program running on a computer. As the user interacting with the visualization zooms in on a fish, a blue window pops up to give some vital information about the computer or program represented by the fish. Fish change color and size to indicate that some important parameter is changing. One could imaging that green fish represent computers not doing much work, while orange fish represent computers loaded with work. It is interesting to see how researchers would use a school of fish as a way to help humans better understand what is going with some complex computation taking place on a cluster of computers. The researchers are relying on human beings's ability to easily pick up visual clues to understand how a large number of systems are operating together. This is certainly better than trying to have the same human beings read tons of log files containing the date and time of many different events occurring in the cluster.