[Solved] Project 4 Introduction the SeaPort Project series

$25

File Name: Project_4_Introduction__the_SeaPort_Project_series.zip
File Size: 471 KB

SKU: [Solved] Project 4 Introduction – the SeaPort Project series Category: Tag:
5/5 - (1 vote)
  1. For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports.Here are the classes and their instance variables we wish to define: SeaPortProgram extends JFrameo variables used by the GUI interfaceo world: World Thing implement Comparable <Thingo index: into name: Stringo parent: int World extends Thingo ports: ArrayList <SeaPorto time: PortTime SeaPort extends Thingo docks: ArrayList <Docko que: ArrayList <Ship // the list of ships waiting to docko ships: ArrayList <Ship // a list of all the ships at this porto persons: ArrayList <Person // people with skills at this port Dock extends Thingo ship: Ship Ship extends Thingo arrivalTime, dockTime: PortTimeo draft, length, weight, width: doubleo jobs: ArrayList <Job PassengerShip extends Shipo numberOfOccupiedRooms: into numberOfPassengers: into numberOfRooms: int CargoShip extends Shipo cargoValue: doubleo cargoVolume: doubleo cargoWeight: double Person extends Thingo skill: String Job extends Thing optional till Projects 3 and 4o duration: doubleo requirements: ArrayList <String// should be some of the skills of the persons PortTimeo time: intEventually, in Projects 3 and 4, you will be asked to show the progress of the jobs using JProgressBars.

Heres a very quick overview of all projects:1. Read a data file, create the internal data structure, create a GUI to display the structure, and let the user search the structure.2. Sort the structure, use hash maps to create the structure more efficiently.3. Create a thread for each job, cannot run until a ship has a dock, create a GUI to show the progress of each job.4. Simulate competing for resources (persons with particular skills) for each job.Project 4 General ObjectivesProject 4 Concurrency Resource poolso Threads competing for multiple resources Blocking threads Extending the GUI interface to visualize the resource pools and progress of the various threads.Documentation Requirements:You should start working on a documentation file before you do anything else with these projects, and fill in items as you go along. Leaving the documentation until the project is finished is not a good idea for any number of reasons.The documentation should include the following (graded) elements: Cover page (including name, date, project, your class information) Designo including a UML class diagramo classes, variables and methods: what they mean and why they are thereo tied to the requirements of the project Users Guideo how would a user start and run your projecto any special featureso effective screen shots are welcome, but dont overdo this Test Plano do this BEFORE you code anythingo what do you EXPECT the project to doo justification for various data files, for example Lessons Learnedo express yourself hereo a way to keep good memories of successes after hard work

Project 4 Specific Goals:Extend project 3 to include making jobs wait until people with the resources required by the job are available at the port.Elaboration:1. Reading Job specifications from a data file and adding the required resources to each Job instance.2. Resource pools SeaPort.ArrayList <Person list of persons with particular skills at each port, treated as resource pools, along with supporting assignment to ships and jobs.3. Job threads using the resource pools and supporting the concept of blocking until required resources are available before proceeding.4. The Job threads should be efficient:1. If the ship is at a dock and all the people with required skills are available, the job should start.2. Otherwise, the Job should not hold any resources if it cannot progress.3. Use synchronization to avoid race conditions.4. Each Job thread should hold any required synchronization locks for a very short period.5. When a job is over, all the resources used by the job (the people) should be released back to the port.6. When all the jobs of a ship are done, the ship should depart the dock and if there are any ships in the port que, one of then should should be assigned to the free dock, and that ships jobs can now try to progress.7. NOTE: If a job can never progress because the port doesnt have enough skills among all the persons at the port, the program should report this and cancel the job.5. GUI showing:o Resources in pools how many people with skill are currently availableo Thread progress, resources acquired, and resources requests still outstandingDeliverables:1. Java source code files2. Data files used to test your program3. Configuration files used4. A well-written document including the following sections:a. Design: including a UML class diagram showing the type of the class relationshipsb. Users Guide: description of how to set up and run your applicationc. Test Plan: sample input and expected results, and including test data and results, with screen snapshots of some of your test casesd. Optionally, Comments: design strengths and limitations, and suggestions for future improvement and alternative approachese. Lessons Learnedf. Use one of the following formats: MS Word docx or PDF.

Your project is due by midnight, EST, on the day of the date posted in the class schedule. We do not recommend staying up all night working on your project it is so very easy to really mess up a project at the last minute by working when one was overly tired.Your instructors policy on late projects applies to this project.Submitted projects that show evidence of plagiarism will be handled in accordance with UMUC Policy 150.25 Academic Dishonesty and Plagiarism.Format:The documentation describing and reflecting on your design and approach should be written using Microsoft Word or PDF, and should be of reasonable length. The font size should be 12 point. The page margins should be one inch. The paragraphs should be double spaced. All figures, tables, equations, andreferences should be properly labeled and formatted using APA style.Coding Hints: Code format: (See Google Java Style guide for specifics(https://google.github.io/styleguide/javaguide.html))o header comment block, including the following information in each source code file:o file nameo dateo authoro purposeo appropriate comments within the codeo appropriate variable and function nameso correct indentation Errors:o code submitted should have no compilation or run-time errors Warnings:o Your program should have no warningso Use the following compiler flag to show all warnings:javac -Xlint *.javao More about setting up IDEs to show warningso Generics your code should use generic declarations appropriately, and to eliminate allwarnings Elegance:o just the right amount of codeo effective use of existing classes in the JDKo effective use of the class hierarchy, including features related to polymorphism. GUI notes:o GUI should resize nicelyo DO NOT use the GUI editor/generators in an IDE (integrated development environment,such as Netbeans and Eclipse)o Do use JPanel, JFrame, JTextArea, JTextField, JButton, JLabel, JScrollPane panels on panels gives even more control of the display during resizing JTable and/or JTree for Projects 2, 3 and 45 Font using the following gives a nicer display for this program, setting for theJTextArea jta:jta.setFont (new java.awt.Font (Monospaced, 0, 12));o GridLayout and BorderLayout FlowLayout rarely resizes nicely GridBagLayout for extreme control over the displays you may wish to explore other layout managerso ActionListener, ActionEvent responding to JButton events Starting with JDK 8, lambda expression make defining listeners MUCH simpler.See the example below, with jbr (read), jbd (display) and jbs (search) threedifferent JButtons.jcb is a JComboBox <String and jtf is a JTextField.jbr.addActionListener (e readFile());jbd.addActionListener (e displayCave ());jbs.addActionListener (e search ((String)(jcb.getSelectedItem()),jtf.getText()));o JFileChooser select data file at run timeo JSplitPane optional, but gives user even more control over display panelsGrading Rubric:Attribute Meets Does not meetDesign 20 pointsContains just the right amount ofcode.Uses existing classes in the JDKeffectively.Effectively uses of the classhierarchy, including featuresrelated to polymorphism.GUI elements should be distinctfrom the other classes in theprogram.0 pointsDoes not contain just the right amountof code.Does not use existing classes in the JDKeffectively.Does not effectively use of the classhierarchy, including features related topolymorphism.GUI elements are not distinct from theother classes in the program.Functionality 40 pointsContains no coding errors.Contains no compile warnings.Builds from previous projects.Includes reading Job specificationsfrom a data file and adding the0 pointsContains coding errors.Contains compile warnings.Does not build from previous projects.Does not include reading Jobspecifications from a data file and6required resources to each Jobinstance.Includes resource pools SeaPort.ArrayList <Person list ofpersons with particular skills ateach port, treated as resourcepools, along with supportingassignment to ships and jobs.Includes job threads using theresource pools and supporting theconcept of blocking until requiredresources are available beforeproceeding.The Job threads should be efficient.GUI shows resources in pools howmany people with skill are currentlyavailable and thread progress,resources acquired, and resourcesrequests still outstanding.adding the required resources to eachJob instance.Does not include resource pools SeaPort.ArrayList <Person list ofpersons with particular skills at eachport, treated as resource pools, alongwith supporting assignment to shipsand jobs.Does not include job threads using theresource pools and supporting theconcept of blocking until requiredresources are available beforeproceeding.The Job threads are not efficient.GUI does not show resources in pools how many people with skill arecurrently available and threadprogress, resources acquired, andresources requests still outstanding.Test Data 20 pointsTests the application using multipleand varied test cases.0 pointsDoes not test the application usingmultiple and varied test cases.Documentation andsubmission15 pointsSource code files include headercomment block, including filename, date, author, purpose,appropriate comments within thecode, appropriate variable andfunction names, correctindentation.Submission includes Java sourcecode files, Data files used to testyour program, Configuration filesused.Documentation includes a UMLclass diagram showing the type ofthe class relationships.0 pointsSource code files do not include headercomment block, or include file name,date, author, purpose, appropriatecomments within the code, appropriatevariable and function names, correctindentation.Submission does not include Javasource code files, Data files used to testyour program, Configuration files used.Documentation does not include a UMLclass diagram showing the type of theclass relationships.Documentation does not include ausers Guide describing of how to setup and run your application.7Documentation includes a usersGuide describing of how to set upand run your application.Documentation includes a test planwith sample input and expectedresults, test data and results andscreen snapshots of some of yourtest cases.Documentation includes Lessonslearned.Documentation is in an acceptableformat.Documentation does not include a testplan with sample input and expectedresults, test data and results and screensnapshots of some of your test cases.Documentation does not includeLessons learned.Documentation is not in an acceptableformat.Documentation form,grammar and spelling5 pointsDocument is well-organized.The font size should be 12 point.The page margins should be oneinch.The paragraphs should be doublespaced.All figures, tables, equations, andreferences should be properlylabeled and formatted using APAstyle.The document should containminimal spelling and grammaticalerrors.0 pointsDocument is not well-organized.The font size is not 12 point.The page margins are not one inch.The paragraphs are not double spaced.All figures, tables, equations, andreferences are not properly labeled orformatted using APA style.The document should contains manyspelling and grammatical errors.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] Project 4 Introduction the SeaPort Project series
$25