/* ------------------------------------------------------------------------- * MSTriggeredRerouter - methods * ----------------------------------------------------------------------- */ MSTriggeredRerouter::MSTriggeredRerouter(const std::string &id, const std::vector<MSEdge*> &edges, SUMOReal prob, const std::string &file, bool off) : MSTrigger(id), SUMOSAXHandler(file), myProbability(prob), myUserProbability(prob), myAmInUserMode(false) { // read in the trigger description if (!XMLSubSys::runParser(*this, file)) { throw ProcessError(); } // build actors #ifdef HAVE_MESOSIM if (MSGlobals::gUseMesoSim) { for (std::vector<MSEdge*>::const_iterator j=edges.begin(); j!=edges.end(); ++j) { MESegment *s = MSGlobals::gMesoNet->getSegmentForEdge(**j); s->addRerouter(this); } } else { #endif for (std::vector<MSEdge*>::const_iterator j=edges.begin(); j!=edges.end(); ++j) { const std::vector<MSLane*> &destLanes = (*j)->getLanes(); for (std::vector<MSLane*>::const_iterator i=destLanes.begin(); i!=destLanes.end(); ++i) { mySetter.push_back(new Setter(this, (*i))); } } #ifdef HAVE_MESOSIM } #endif if (off) { setUserMode(true); setUserUsageProbability(0); } }