Assignment 11Due Nov 5, on line
Part of
the homework for CS:2820, Fall 2020
|
Here is a bit of Java code from class Person in the reference soluton to MP8. Several of the questions below are about this code.
private void beInfectious( double time ) { numLatent = numLatent - 1; infectionState = States.infectious; numInfectious = numInfectious + 1; if (place != null) place.oneMoreInfectious( time ); if (rand.nextFloat() > bedriddenProb) { // person stays asymptomatic double delay = rand.nextLogNormal( infectRecMedT, infectRecScatT ); Simulator.schedule( delay + time, (double t)-> beRecovered( t ) ); } else { // person becomes bedridden double delay = rand.nextLogNormal( infectBedMedT, infectBedScatT ); Simulator.schedule( delay + time, (double t)-> beBedridden( t ) ); } }
Break the reference solution to MP8 into separate files, one per class, and make sure it still works, then submit your code for class Person. We will test it by compiling your code and letting Java link it wity our code for the other classes.
You are free to fix any bugs within class Person that do not require any changes to code in other classes.
Note that you will be completely responsible for issues of style, and that your code will be checked both by javac and by javadoc so make sure there are no errors flagged by either one of them. Quality of Javadoc comments is definitely relevant here!
Submit your code for class Person in the usual way.
A student asked: Do you want us to submit a shell archive or just a single source file holding class Person?
Just submit a single source file, Person.java. Do not add any of the mechanisms for a shell archive. Do not submit more than one class.
I will distribute the solution as a shell archive so you can see all the classes we use to test your code, but you should only submit one source file.
A student asked: Do we have to use your code or can we break our code into multiple classes?
We will grade your work by compiling your submitted Person.java file combined with our files for all the other classes. If your code is compatible with our code, it will work. We really don't care if you use my code for Person.java so long a your code works in the context of our code for all the other classes.
That said, the easy path to a solution is just to break the distributed solution to MP8 into separate source files and submit the resulting Person.java file. If you really want to submit your Person.java file, you'll have to break up my solution so you can test to see how your Person.java file works in the context of my solution to the rest of the problem. I will not state that this is impossible, but it is definitely more work!