Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Simulator:: iniToJunctionMap(){
- boost::property_tree::ptree pt;
- boost::property_tree::ini_parser::read_ini("RoadMap.ini", pt);
- for (boost::property_tree::ptree::const_iterator sectionIter = pt.begin();sectionIter != pt.end(); sectionIter++) {
- string end=sectionIter->first;
- Junction* newJunction = new Junction (end,*this);
- for (boost::property_tree::ptree::const_iterator propertyIter = sectionIter->second.begin(); propertyIter != sectionIter->second.end(); propertyIter++){
- string start=propertyIter->first;
- string roadId=start+end;
- Road* incomingRoad = (RoadMap[roadId]);
- newJunction->incomingRoads.push_back(incomingRoad);
- }
- JunctionMap.insert(pair<string,Junction*>(end,newJunction));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement