Difference between revisions of "CSC212 Final Project 2014"

From dftwiki3
Jump to: navigation, search
(Submission)
(Case 2)
 
(7 intermediate revisions by the same user not shown)
Line 19: Line 19:
 
=Assignment=
 
=Assignment=
 
* Implement a '''Model-View-Controller''' in Processing that visualizes a network of vertices.
 
* Implement a '''Model-View-Controller''' in Processing that visualizes a network of vertices.
* The model should use the graph implementation shown on [[CSC212_Disjkstra%27s_Shortest_Path | this page]].   
+
* The model should use the graph implementation shown on [[CSC212_Disjkstra%27s_Shortest_Path | this page]].  <font color="read">It cannot use an adjacency matrix defined as an int[][] array, or a boolean[][] array.</font>
 
* Inspire yourself from the video below when designing your MVC.
 
* Inspire yourself from the video below when designing your MVC.
 
* Your MVC should provide 3 different features:
 
* Your MVC should provide 3 different features:
Line 53: Line 53:
  
 
=Submission=
 
=Submission=
 +
<br />
 +
<font color="red">material added on 12/11/14 @ 5:40 p.m.
 +
You need to submit two files: a ''jar'' file and a ''zip'' file.  The zip file is just a regular zip file containing the .java files (not the .class files) making up your project.  </font>
 +
==ZIP File==
 +
<br />
 +
* [http://support.apple.com/kb/ph4048How to create a zip file on a Mac]
 +
* [http://windows.microsoft.com/en-us/windows/compress-uncompress-files-zip-files#1TC=windows-7 How to create a zip file on Windows]
 +
<br />
 +
==JAR File==
 +
<br />
 +
<font color="red">This section was modified on 12/13/14, at 8:15 a.m.</font>
 
<br />
 
<br />
 
You need to create a '''runable jar''' containing your project, and submit it.  Jar means '''J'''ava-'''ar'''chive file.  The steps are tricky, and may require several attempts to create the right kind of file.  Make sure you give yourself enough time before the deadline to create the right type of file.  Practice!  I ''strongly recommend'' that you submit your project every time you have implemented a new major feature in your project.  This way you avoid getting a 0 for not being able to submit your file at the last minute.   
 
You need to create a '''runable jar''' containing your project, and submit it.  Jar means '''J'''ava-'''ar'''chive file.  The steps are tricky, and may require several attempts to create the right kind of file.  Make sure you give yourself enough time before the deadline to create the right type of file.  Practice!  I ''strongly recommend'' that you submit your project every time you have implemented a new major feature in your project.  This way you avoid getting a 0 for not being able to submit your file at the last minute.   
 +
<br />
 +
There are two cases possible, depending on how you created your project.  The image below illustrates the two cases.
 +
<br />
 +
<center>[[Image:EclipseHowToCreateRunableJar.png]]</center>
 +
<br />
 +
* In Case 1, you have created your java files directly by clicking '''New''' on the '''src''' folder, not specifying a '''package'''.  In this case your java files are in the ''default package''.
 +
<br />
 +
* In Case 2, you have first created a '''package''' in your '''src''' folder, and then created your java files inside that package.  In my case, the package is called ''FinalProject'' (in the image above). 
 +
<br />
 +
===Case 1===
 
<br />
 
<br />
 
<br />
 
<br />
Line 83: Line 104:
 
You have now created a self-contained, running java applet inside a java archive file.  This is the file you need to submit in the '''Final Project''' section in Moodle.
 
You have now created a self-contained, running java applet inside a java archive file.  This is the file you need to submit in the '''Final Project''' section in Moodle.
 
<br />
 
<br />
===Option 2===
+
===Case 2===
 +
<br />
 +
'''Steps:'''
 +
<br />
 +
::'''1.''' add a new main() method to your viewer.  We normally don't need one, as the PApplet has its own, but we need to fool eclipse in thinking it is exporting an ''application'' and not an ''applet''.  The string inside main should contain the name of your viewer class.  In my case, the class is MVC1_viewer.  Change this according to your own naming convention.
 +
<br />
 +
:::<source lang="java">
 +
        static public void main(String args[]) {
 +
    PApplet.main( "FinalProject.MVC1_viewer" );
 +
}
 +
</source>
 +
<br />
 +
::'''2.''' Click on the viewer edit window, to make sure it is selected.  Find the '''Run As''' option, to run the program, and select '''Run as Java Application'''.  Make sure your applet runs normally.
 +
<br />
 +
::'''3.''' Stop your program
 +
<br />
 +
::'''4.''' In the '''Package Explorer''', select the <font color="red">'''package'''</font> containing your java files.  Right/Control click on it, and click '''Export'''.  Select '''Java''', '''Runnable JAR file''', then '''Next'''.
 +
<br />
 +
::'''5.''' In the '''Launch configuration''', select your viewer class.  Pick a destination folder, and name your file '''yourLastName_project.jar''' (replace "yourLastName" by your actual last name).  Select '''Extract required libraries into generated JAR'''.  Click '''Finish'''.  Don't worry about generated warnings.
 +
<br />
 +
::'''6.''' Open a DOS window or a Terminal, depending on your computer, and '''cd''' your way to the folder/directory containing the jar file you just created.  Once you're there, type the following command at the prompt:
 +
<br />
 +
:::::<tt>java -jar yourLastName_project.jar</tt>
 +
<br />
 +
:::Verify that your applet starts and works correctly. 
 +
<br />
 +
You have now created a self-contained, running java applet inside a java archive file.  This is the file you need to submit in the '''Final Project''' section in Moodle.
 +
<br />
 +
 
 +
==Zip Only==
 +
<br />
 +
* Not providing the JAR file and only the ZIP file will count for a maximum of 70 points, instead of 100.
 +
<br />
 +
<br />
 +
<br />
 +
<br />
 +
<br />
 +
<br />
 +
<br />
 +
<br />
 +
<br />
 +
<br />
 +
<br />
 
<br />
 
<br />
* This option will be worth at most 70 points instead of the max of 100.
 
* If you cannot create a runnable jar that runs on your computer from the command line, then create a '''zip''' file containing
 
::* all the java classes you are using for your project (including buttons and other graphic elements you may have created classes for)
 
::* core.jar
 
* Connect to Moodle, and submit the .zip file instead of the .jar file.
 
 
<br />
 
<br />
 
<br />
 
<br />

Latest revision as of 21:25, 18 December 2014

--D. Thiebaut (talk) 11:09, 28 November 2014 (EST)



         

This project is to be done individually. It is given under the rules of Smith's Honor Code. You have access to all your class notes, solution programs made available for various labs and/or homework assignments, to the textbook, and to the Web. The project is due on the last day of exam period, 19 Dec. 2014, at 4:00 p.m. No extensions will be granted.
TAs will be asked to give only reduced amount of help, mostly in the form of debugging help, but not to help figuring out details of implementation. This reduced TA help will stop on the last day of class, at 4:00 p.m.
Questions about the project can only be asked in class, or on Piazza. You cannot post significant sections of code on Piazza.



Assignment

  • Implement a Model-View-Controller in Processing that visualizes a network of vertices.
  • The model should use the graph implementation shown on this page. It cannot use an adjacency matrix defined as an int[][] array, or a boolean[][] array.
  • Inspire yourself from the video below when designing your MVC.
  • Your MVC should provide 3 different features:
  • It should be able to highlight all the vertices connected to the vertex under the mouse pointer.
  • It should be able to display the shortest path from the last clicked vertex (marked with a red dot) to the vertex currently under the mouse pointer.
  • It should implement a third functionality that you are free to choose, and will depend on how ambitious you are.



Features


Your MVC should have at least 3 buttons:

  • one button will control whether the connected component of a vertex is shown or not.
  • one button will control whether the shortest path from the last-clicked vertex to the one under the mouse should be shown or not
  • one button will display a simple box on the applet that will contain:
  • Your name
  • The date you submitted your project
  • A short description of your project (40 to 50 words, max)
  • one or more button(s) (optional) that will control your selected feature (see Assignment section above)


Ideas


Here is a non-exhaustive list of possible "third feature" you may want to consider. The maximum number of points for the 3rd feature is 30 out of a total of 100 for the whole project.

  • Your MVC displays the number of connected component (5 points)
  • Your MVC can generate a brand new graph when the user clicks on a button (5 points)
  • Your MVC colors each connected component with a different color and displays all of them at once (15 points)
  • Your MVC allows the user to dynamically add/remove edges to/from the network. The connected components, shortest paths, and all other graph properties are automatically updated after each operation (30 points)
  • Your MVC allows the user to dynamically choose the probability of creating edges, and creates a brand new graph (with its associated properties) every time the probability is changed (30 points)
  • Your MVC draws the tree created by DFS when starting on the vertex under the mouse pointer.


Submission


material added on 12/11/14 @ 5:40 p.m. You need to submit two files: a jar file and a zip file. The zip file is just a regular zip file containing the .java files (not the .class files) making up your project.

ZIP File



JAR File


This section was modified on 12/13/14, at 8:15 a.m.
You need to create a runable jar containing your project, and submit it. Jar means Java-archive file. The steps are tricky, and may require several attempts to create the right kind of file. Make sure you give yourself enough time before the deadline to create the right type of file. Practice! I strongly recommend that you submit your project every time you have implemented a new major feature in your project. This way you avoid getting a 0 for not being able to submit your file at the last minute.
There are two cases possible, depending on how you created your project. The image below illustrates the two cases.

EclipseHowToCreateRunableJar.png


  • In Case 1, you have created your java files directly by clicking New on the src folder, not specifying a package. In this case your java files are in the default package.


  • In Case 2, you have first created a package in your src folder, and then created your java files inside that package. In my case, the package is called FinalProject (in the image above).


Case 1



Steps:

1. add a new main() method to your viewer. We normally don't need one, as the PApplet has its own, but we need to fool eclipse in thinking it is exporting an application and not an applet. The string inside main should contain the name of your viewer class. In my case, the class is MVC1_viewer. Change this according to your own naming convention.


        static public void main(String args[]) {
	     PApplet.main( "MVC1_viewer" );
	}


2. Click on the viewer edit window, to make sure it is selected. Find the Run As option, to run the program, and select Run as Java Application. Make sure your applet runs normally.


3. Stop your program


4. In the Package Explorer, select the project containing your java files. Right/Control click on it, and click Export. Select Java, Runnable JAR file, then Next.


5. In the Launch configuration, select your viewer class. Pick a destination folder, and name your file yourLastName_project.jar (replace "yourLastName" by your actual last name). Select Extract required libraries into generated JAR. Click Finish. Don't worry about generated warnings.


6. Open a DOS window or a Terminal, depending on your computer, and cd your way to the folder/directory containing the jar file you just created. Once you're there, type the following command at the prompt:


java -jar yourLastName_project.jar


Verify that your applet starts and works correctly.


You have now created a self-contained, running java applet inside a java archive file. This is the file you need to submit in the Final Project section in Moodle.

Case 2


Steps:

1. add a new main() method to your viewer. We normally don't need one, as the PApplet has its own, but we need to fool eclipse in thinking it is exporting an application and not an applet. The string inside main should contain the name of your viewer class. In my case, the class is MVC1_viewer. Change this according to your own naming convention.


        static public void main(String args[]) {
	     PApplet.main( "FinalProject.MVC1_viewer" );
	}


2. Click on the viewer edit window, to make sure it is selected. Find the Run As option, to run the program, and select Run as Java Application. Make sure your applet runs normally.


3. Stop your program


4. In the Package Explorer, select the package containing your java files. Right/Control click on it, and click Export. Select Java, Runnable JAR file, then Next.


5. In the Launch configuration, select your viewer class. Pick a destination folder, and name your file yourLastName_project.jar (replace "yourLastName" by your actual last name). Select Extract required libraries into generated JAR. Click Finish. Don't worry about generated warnings.


6. Open a DOS window or a Terminal, depending on your computer, and cd your way to the folder/directory containing the jar file you just created. Once you're there, type the following command at the prompt:


java -jar yourLastName_project.jar


Verify that your applet starts and works correctly.


You have now created a self-contained, running java applet inside a java archive file. This is the file you need to submit in the Final Project section in Moodle.

Zip Only


  • Not providing the JAR file and only the ZIP file will count for a maximum of 70 points, instead of 100.