next up previous contents
Next: Vehicle insertion Up: Plans following in the Previous: Park queue   Contents

Wait queue

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() ;
    }
    ...
};

Task 9.2   Read your plans into your simulation.

Task 9.3   Read the network and the plans from


        http://www.matsim.org/files/studies/corridor/teach

into your simulation.

A sketch of the ``corridor'' network is given in Fig. 9.1.

Figure 9.1: Sketch of the ``corridor'' network. The numbers give the corresponding node and link IDs.
\includegraphics[width=0.8\hsize]{axhausen-net-fig.eps}


next up previous contents
Next: Vehicle insertion Up: Plans following in the Previous: Park queue   Contents
2004-02-02