The wait queue, as also explained above, contains vehicles whose starting time has passed but they have not made it into the traffic because of congestion. The separation between park and wait queue seems somewhat arbitrary at this point. It is necessary to provide an efficient way to write ``events'' when vehicles intend to start, even if they do not make it into the traffic in the same time step (Sec. 9.11).
Here is a mechanism for the wait queue:
{} class Link { ... private: typedef deque<Veh*> WaitQueue ; WaitQueue waitQueue_ ; public: void addToWait( Veh* veh ) { waitQueue_.push_back( veh ) ; } Veh* firstInWait() { if ( waitQueue_.size()>=1 ) { return waitQueue_.front() ; } else { return NULL ; } } void rmFirstInWait() { assert( waitQueue_.size() >= 1 ) ; waitQueue_.pop_front() ; } ... };
A sketch of the ``corridor'' network is given in Fig. 9.1.
|