FinalExam Review Fall2005: Make a Super Truck
Questions? Comments? Answers?
(Back to Final Exam Review Fall2005)
I do not think it is supposed to be THIS easy, so I am really thinking my answer is wrong. I am really bad with simulation, but if I had to modify the code for super trucks I would probably:
//// METHODS ///
/** A new load is between 20 and 30 on a uniform distribution */
public int newLoad(){
return 20+randNumGen.nextInt(11);
}
/**A trip distance averages 2 days*/
public double tripTime(){
double delay = randNumGen.nextGaussian()+2;
if (delay < 1)
// Must take at least one day
{return 1.0+((DESimulation) simulation).getTime();}
else {return delay+((DESimulation) simulation).getTime();}
}
Removed at TB request
I think that's right, I mean you're just changing two variables right? The code still acts the same way.
Kyle DuPont
that's what i got, tannis.
Removed at KS request
Thanks .... guess it was pretty simple....DOUBT IT WILL LOOK LIKE THAT TOMORROW MORNING :) Removed at TB request
Link to this Page