I am supposed to simulate a one runway airport's operations over a given period of time. What I have done is create queues to hold planes that are ready to take off and land respectively. I created a class to represent a plane due to the fact that I am required to monitor how long it is kept in the queue. So to add a "plane" to either queue, a condition is tested(a function that returns true/false based on randomness) and if true a plane is added. My problem is that is there a way a new "plane" can be declared and then added to the queue? For example, assuming "landing" is an already declared queue:
if(condition)
create plane
landing.push(created plane)
Aucun commentaire:
Enregistrer un commentaire