C ! C"#C!C !C
C ! C"#C!C !C
1.
Connect the statement Only God is all-knowing to the statement Humans are using numbers to simplify simulation experiments. (20 pts) If the concept of randomness does not exist in human reasoning, what possibilities would humans be like? (20pts) If the concept of randomness does not exist in human reasoning, what would humans be like aside from being reduced to mere animals? (10 pts) Explain how do you derive a range of random numbers by merely using the random number generated by Math.random(). (10 pts) No simulation model can exist if it does not employ the use of random numbers. Affirm or denounce this statement. Give an argument to your point. (20 pts) Will the use of random number truly solve a problem? Explain your answer. (20 pts)
2.
3.
4.
5.
6.
org.cjc.ms.library. InitialDepartureScheduler
public double[] getSchedule(int planePopulation, double average)
This method is responsible for creating a random initial departure schedule for each airplane. Airplanes will be assigned with a plane number starting from zero ( 0, 1 , 2 planePopulation 1). So you will refer to the first airplane as 0 and to the last airplane as planePopulation 1. You will create a distribution of flight schedules with the mean AVERAGE. For Example, If you have the AVERAGE value of 1 hour (Meaning, all planes shall depart in more or less an hour from the start of the simulation) and a plane population of 3. This method may generate the distribution of random numbers: {0.2, 0.5, 0.3} The above distribution tells us that plane#0 departs at 0.2 hours, plane#1 at 0.5 hours and plane#2 at 0.3 hours. Each flight schedule is a double floating point value representing the hour the plane will depart in hours. Parameters:
planePopulation - The Number of planes to schedule average - The average time all airplanes will depart
org.cjc.ms.library. InitialDepartureScheduler
public int convertToMinutes(double hours)
SIMULATOR CONTROLLER MODULE This module is responsible for controlling the behavior of your simulator. This is your main control module where you can start, stop, pause and set how fast the simulation is going to run.
You will extend the abstract class org.cjc.ms.library.SimulatorController to create a controller. You must therefore provide the codes for the following methods:
org.cjc.ms.library.SimulatorController
public abstract void start()
Initializes and starts the simulation thread. The simulation thread will increment the simulationTime. After each increment, the method simulationTimeChanged(time) MUST be invoked. In addition to that, after each increment the thread must pause for a certain time set by the method setSleep(sleepTime). If the simulation is paused then invoking this method will continue incrementing the simulation time. If the simulation is stopped, then invoking this method will reset the thread and the simulation time back to zero.
org.cjc.ms.library.SimulatorController
public abstract void pause()
Pauses the increment of the simulation time but not necessarily the simulation thread.
org.cjc.ms.library.SimulatorController
public abstract void pause()
Pauses the increment of the simulation time but not necessarily the simulation thread.
org.cjc.ms.library.SimulatorController
public abstract void setSleep(int sleepTime)
Sets the time to sleep after each increment of the simulation time. Parameters:
sleepTime The new sleep time
HOW TO TEST IF IMPLEMENTATIONS ARE CORRECT? Invoke the following code as shown in the diagram:
public static void main(String[] args) { org.cjc.ms.library.Tester.test(new InitialDepartureSchedulerImp(), new SimulatorControllerImp()); } } In the diagram above, the InitialDepartureSchedulerImp refers to your implementation of the InitialDepartureScheduler interface. While the SimulatorControllerImp refers to the class you extended from the SimulatorController abstract class. In order to pass your code, please make sure you invoke the above code. It will automatically call into the database and update your rankings.