Difference between revisions of "CSC352 Homework 2 2013"
(Created page with "--~~~~ ---- <center> <font size="+2">Page under construction!</font> <br \>300px </center> =Multithreaded Packing= The idea for this homework ...") |
(→First, Play!) |
||
Line 7: | Line 7: | ||
The idea for this homework is simple. You get a Processing application that is highly serial and that packs rectangles into a rectangular applet, and you make it parallel by adding a thread that generates packed rectangles, i.e. rectangles that are positioned in the area of the applet in such a way that they touch each other but do not overlap, and at the same time minimize the wasted area. | The idea for this homework is simple. You get a Processing application that is highly serial and that packs rectangles into a rectangular applet, and you make it parallel by adding a thread that generates packed rectangles, i.e. rectangles that are positioned in the area of the applet in such a way that they touch each other but do not overlap, and at the same time minimize the wasted area. | ||
− | ==First, | + | <br /> |
+ | ==First, Get the Code== | ||
+ | <br /> | ||
Two different versions of the initial code is available to you. One to run in the native Processing IDE, the other to run with Eclipse (which you are highly encourage to use--Eclipse is a bit tough to setup to run with Processing apps, but one you are done, you benefit from the great features of Eclipse). | Two different versions of the initial code is available to you. One to run in the native Processing IDE, the other to run with Eclipse (which you are highly encourage to use--Eclipse is a bit tough to setup to run with Processing apps, but one you are done, you benefit from the great features of Eclipse). | ||
Line 17: | Line 19: | ||
* [http://cs.smith.edu/~dthiebaut/research/packing/PackingHw2IDE.tgz PackingHw2IDE.tgz] | * [http://cs.smith.edu/~dthiebaut/research/packing/PackingHw2IDE.tgz PackingHw2IDE.tgz] | ||
</onlysmith> | </onlysmith> | ||
+ | |||
+ | If you go with the native Processing app, just download the *IDE.tgz file and unpack it in a Terminal window on your Mac: | ||
+ | |||
+ | tar xzvf ''nameOfTheTgzFile'' | ||
+ | |||
+ | You will get a new directory called PackingHw2. That's your sketch. Open it with the Processing IDE, and run '''PackingHw2'''. You should get a blank applet opened in front of you. | ||
+ | |||
+ | If you go with the Eclipse version (good on you!), then download it and unpack it similarly. You can then import it as ''File System'' into your workspace. The main application is '''PackingHw2'''. Just run it and you should have a blank applet in front of you. | ||
+ | |||
+ | <br /> | ||
+ | ==Time to Play!== | ||
+ | <br /> | ||
+ | Once you have the appet opened in front of you, press the ENTER key a few times. You should see some pink rectangles appear on the screen. | ||
+ | <br /> | ||
+ | <center> | ||
+ | [[CSC352Homework2_2013_Packing1.png|500px]] | ||
+ | </center> | ||
+ | <br /> |
Revision as of 16:22, 20 September 2013
--D. Thiebaut (talk) 17:10, 20 September 2013 (EDT)
Multithreaded Packing
The idea for this homework is simple. You get a Processing application that is highly serial and that packs rectangles into a rectangular applet, and you make it parallel by adding a thread that generates packed rectangles, i.e. rectangles that are positioned in the area of the applet in such a way that they touch each other but do not overlap, and at the same time minimize the wasted area.
First, Get the Code
Two different versions of the initial code is available to you. One to run in the native Processing IDE, the other to run with Eclipse (which you are highly encourage to use--Eclipse is a bit tough to setup to run with Processing apps, but one you are done, you benefit from the great features of Eclipse).
The two different versions are available below (but only accessible from Smith campus computers. If you are off-campus, please email me).
If you go with the native Processing app, just download the *IDE.tgz file and unpack it in a Terminal window on your Mac:
tar xzvf nameOfTheTgzFile
You will get a new directory called PackingHw2. That's your sketch. Open it with the Processing IDE, and run PackingHw2. You should get a blank applet opened in front of you.
If you go with the Eclipse version (good on you!), then download it and unpack it similarly. You can then import it as File System into your workspace. The main application is PackingHw2. Just run it and you should have a blank applet in front of you.
Time to Play!
Once you have the appet opened in front of you, press the ENTER key a few times. You should see some pink rectangles appear on the screen.