Project 4 - Linear Program Converter |
< Previous Next > |
minimize -2x_1 + 3x_2 subject to x_1 + x_2 = 7 x_1 - 2x_2 <= 4 x_1 >= 0 x_2 >= 0Your program should match the following output exactly:
Please enter the input filename (or simply press return to use ./project4-testA.txt) Converting the linear program in ./project4-testA.txt . . . maximize 2x_1 - 3x_2 subject to x_3 = 7 - x_1 - x_2 x_4 = -7 + x_1 + x_2 x_5 = 4 - x_1 + 2x_2 x_1, x_2, x_3, x_4, x_5 >= 0Additionally, here's a second input file: project4-testB.txt:
minimize -x_1 - 2x_2 + x_3 subject to 2x_1 + x_2 + x_3 <= 14 4x_1 + 2x_2 + 3x_3 <= 28 2x_1 + 5x_2 + 5x_3 <= 30 x_1 >= 0 x_2 >= 0 x_3 >= 0Furthermore, here's a third input file: project4-testC.txt:
maximize x_1 + 2x_2 - x_3 subject to -2x_1 - x_2 - x_3 >= -14 4x_1 + 2x_2 + 3x_3 <= 28 2x_1 + 5x_2 + 5x_3 <= 30 x_1 >= 0 x_2 >= 0 x_3 >= 0
Points Item ---------- -------------------------------------------------------------- _____ / 10 Style + Code is indented correctly + Functions should be no longer than 1 page + Documentation: (written for another software developer) * All source code files include Javadoc header block with description, author, version/date, etc. * Javadoc (with block tags) before each method * All non-trivial variables are commented * Comments included before major portions of code _____ / 0 Program compiles without errors _____ / 0 Program executes without crashing Requirements met: _____ / 10 + Objective function is presented in slack form (maximization) _____ / 15 + Equalities in linear program are converted to inequalities _____ / 10 + Greater-than inequalities in linear program are converted to less-than inequalities _____ / 10 + Basic variables are on the left-hand side of the equality sign, followed by a constant, followed by all of the non-basic variables _____ / 8 + Test files [that you made] _____ / 2 Completed rubric _____ / 65 Total _____ Approximate number of hours spent I, (REPLACE WITH YOUR FULL NAME), affirm that the code that I submitted is my own work and that I did not receive help that was not authorized by the instructor.
Copy and paste this rubric into a rubric-project4.txt file (not a .docx, .doc nor .rtf file). Think of this as a checklist to ensure that you receive the maximum points possible. For each grade item, fill in your estimate for the grade you deserve. Additionally, include your estimate of how many hours your spent. Lastly, replace, "(REPLACE WITH YOUR FULL NAME)" with your full name to indicate that what you are submitting is entirely your own work.
javac *.java java LPConverteror
javac *.java -d . java <package_name>.LPConverterwhere <package_name> is replaced by the package name used. If this doesn't work, then please comment out the package statement.
javac *.java # echo "" | ... is the same as typing RETURN echo "" | java Converter &> project4Output.txt diff project4-answerKeyA.txt project4Output.txtIf the two files match exactly (which is what you want) then there should be NO output from diff. If diff shows one or more differences, fix them and run it again. To get side-by-side output (with the answer key on the left and your output on the right), replace the last line with:
diff --side-by-side project4-answerKeyA.txt project4Output.txtFor details about interpreting the output of diff, see the Using diff section on the Misc. webpage.