next up previous contents
Next: Main program Up: Cellular automata micro-simulation Previous: Fairer intersections   Contents

Initializing vehicles for testing purposes

We need to be able to put vehicles on the network. A useful method for this will be discussed in Chap. 9 in conjunction with the introduction of plans. Here we just point out that for testing purposes one can put vehicles on links for example as follows:


{}
Id cnt = 0 ;
for ( Links::iterator ll=links.begin(); ll!=links.end(); ++ll ) {
    Link* link = ll->second ;
    Veh* veh = new Veh ; 
    veh->set_id(cnt) ;
    cnt++ ;
    link->addVeh( Veh ) ;
}



2004-02-02