#include <NIVissimTL.h>
Definition at line 52 of file NIVissimTL.h.
Public Types | |
| typedef std::map< int, SGroupDictType > | GroupDictType |
| typedef std::map< int, NIVissimTLSignalGroup * > | SGroupDictType |
| typedef std::map< int, SSignalDictType > | SignalDictType |
| typedef std::map< int, NIVissimTLSignal * > | SSignalDictType |
Public Member Functions | |
| int | getID () const |
| std::string | getType () const |
| NIVissimTL (int id, const std::string &type, const std::string &name, SUMOTime absdur, SUMOTime offset) | |
| ~NIVissimTL () | |
Static Public Member Functions | |
| static void | clearDict () |
| static bool | dict_SetSignals (NBTrafficLightLogicCont &tlc, NBEdgeCont &ec) |
| static NIVissimTL * | dictionary (int id) |
| static bool | dictionary (int id, NIVissimTL *o) |
| static bool | dictionary (int id, const std::string &type, const std::string &name, SUMOTime absdur, SUMOTime offset) |
Protected Attributes | |
| SUMOTime | myAbsDuration |
| NIVissimTLSignalGroup * | myCurrentGroup |
| int | myID |
| std::string | myName |
| SUMOTime | myOffset |
| std::string | myType |
Private Types | |
| typedef std::map< int, NIVissimTL * > | DictType |
Static Private Attributes | |
| static DictType | myDict |
Data Structures | |
| class | NIVissimTLSignal |
| class | NIVissimTLSignalGroup |
typedef std::map<int, NIVissimTL*> NIVissimTL::DictType [private] |
Definition at line 141 of file NIVissimTL.h.
| typedef std::map<int, SGroupDictType> NIVissimTL::GroupDictType |
Definition at line 77 of file NIVissimTL.h.
| typedef std::map<int, NIVissimTLSignalGroup *> NIVissimTL::SGroupDictType |
Definition at line 75 of file NIVissimTL.h.
| typedef std::map<int, SSignalDictType> NIVissimTL::SignalDictType |
Definition at line 76 of file NIVissimTL.h.
| typedef std::map<int, NIVissimTLSignal *> NIVissimTL::SSignalDictType |
Definition at line 73 of file NIVissimTL.h.
| NIVissimTL::NIVissimTL | ( | int | id, | |
| const std::string & | type, | |||
| const std::string & | name, | |||
| SUMOTime | absdur, | |||
| SUMOTime | offset | |||
| ) |
Definition at line 316 of file NIVissimTL.cpp.
Referenced by dictionary().
00319 : myID(id), myName(name), myAbsDuration(absdur), myOffset(offset), 00320 myCurrentGroup(0), myType(type) 00321 00322 {}
| NIVissimTL::~NIVissimTL | ( | ) |
| void NIVissimTL::clearDict | ( | ) | [static] |
Definition at line 365 of file NIVissimTL.cpp.
References myDict.
Referenced by NIImporter_Vissim::~NIImporter_Vissim().
00365 { 00366 for (DictType::iterator i=myDict.begin(); i!=myDict.end(); i++) { 00367 delete(*i).second; 00368 } 00369 myDict.clear(); 00370 }
| bool NIVissimTL::dict_SetSignals | ( | NBTrafficLightLogicCont & | tlc, | |
| NBEdgeCont & | ec | |||
| ) | [static] |
Definition at line 377 of file NIVissimTL.cpp.
References MsgHandler::getErrorInstance(), NIVissimTL::NIVissimTLSignalGroup::getGroupsFor(), getID(), NIVissimTL::NIVissimTLSignal::getSignalsFor(), MsgHandler::inform(), NBTrafficLightLogicCont::insert(), myAbsDuration, myDict, myID, and WRITE_WARNING.
Referenced by NIImporter_Vissim::postLoadBuild().
00378 { 00379 size_t ref = 0; 00380 size_t ref_groups = 0; 00381 size_t ref_signals = 0; 00382 size_t no_signals = 0; 00383 size_t no_groups = 0; 00384 for (DictType::iterator i=myDict.begin(); i!=myDict.end(); i++) { 00385 NIVissimTL *tl = (*i).second; 00386 /* if(tl->myType!="festzeit") { 00387 cout << " Warning: The traffic light '" << tl->myID 00388 << "' could not be assigned to a node." << endl; 00389 ref++; 00390 continue; 00391 }*/ 00392 std::string id = toString<int>(tl->myID); 00393 NBLoadedTLDef *def = new NBLoadedTLDef(id); 00394 if (!tlc.insert(def)) { 00395 MsgHandler::getErrorInstance()->inform("Error on adding a traffic light\n Must be a multiple id ('" + id + "')"); 00396 continue; 00397 } 00398 def->setCycleDuration((unsigned int) tl->myAbsDuration); 00399 // add each group to the node's container 00400 SGroupDictType sgs = NIVissimTLSignalGroup::getGroupsFor(tl->getID()); 00401 for (SGroupDictType::const_iterator j=sgs.begin(); j!=sgs.end(); j++) { 00402 if (!(*j).second->addTo(def)) { 00403 WRITE_WARNING("The signal group '" + toString<int>((*j).first)+ "' could not be assigned to tl '"+ toString<int>(tl->myID) + "'."); 00404 ref_groups++; 00405 } 00406 no_groups++; 00407 } 00408 // add the signal group signals to the node 00409 SSignalDictType signals = NIVissimTLSignal::getSignalsFor(tl->getID()); 00410 for (SSignalDictType::const_iterator k=signals.begin(); k!=signals.end(); k++) { 00411 if (!(*k).second->addTo(ec, def)) { 00412 WRITE_WARNING("The signal '" + toString<int>((*k).first)+ "' could not be assigned to tl '" + toString<int>(tl->myID) + "'."); 00413 ref_signals++; 00414 } 00415 no_signals++; 00416 } 00417 } 00418 if (ref!=0) { 00419 WRITE_WARNING("Could not set " + toString<size_t>(ref)+ " of " + toString<size_t>(myDict.size())+ " traffic lights."); 00420 } 00421 if (ref_groups!=0) { 00422 WRITE_WARNING("Could not set " + toString<size_t>(ref_groups)+ " of " + toString<size_t>(no_groups)+ " groups."); 00423 } 00424 if (ref_signals!=0) { 00425 WRITE_WARNING("Could not set " + toString<size_t>(ref_signals)+ " of " + toString<size_t>(no_signals)+ " signals."); 00426 } 00427 return true; 00428 00429 }
| NIVissimTL * NIVissimTL::dictionary | ( | int | id | ) | [static] |
Definition at line 355 of file NIVissimTL.cpp.
References myDict.
00355 { 00356 DictType::iterator i=myDict.find(id); 00357 if (i==myDict.end()) { 00358 return 0; 00359 } 00360 return (*i).second; 00361 }
| bool NIVissimTL::dictionary | ( | int | id, | |
| NIVissimTL * | o | |||
| ) | [static] |
| bool NIVissimTL::dictionary | ( | int | id, | |
| const std::string & | type, | |||
| const std::string & | name, | |||
| SUMOTime | absdur, | |||
| SUMOTime | offset | |||
| ) | [static] |
Definition at line 332 of file NIVissimTL.cpp.
References NIVissimTL().
Referenced by NIVissimSingleTypeParser_Signalgruppendefinition::parse(), NIVissimSingleTypeParser_Signalgeberdefinition::parse(), NIVissimSingleTypeParser_Lichtsignalanlagendefinition::parseFixedTime(), NIVissimSingleTypeParser_Lichtsignalanlagendefinition::parseRestActuated(), and NIVissimSingleTypeParser_Lichtsignalanlagendefinition::parseVAS().
00334 { 00335 NIVissimTL *o = new NIVissimTL(id, type, name, absdur, offset); 00336 if (!dictionary(id, o)) { 00337 delete o; 00338 return false; 00339 } 00340 return true; 00341 }
| int NIVissimTL::getID | ( | ) | const |
Definition at line 439 of file NIVissimTL.cpp.
References myID.
Referenced by dict_SetSignals().
00439 { 00440 return myID; 00441 }
| std::string NIVissimTL::getType | ( | ) | const |
Definition at line 433 of file NIVissimTL.cpp.
References myType.
Referenced by NIVissimSingleTypeParser_Signalgruppendefinition::parse().
00433 { 00434 return myType; 00435 }
SUMOTime NIVissimTL::myAbsDuration [protected] |
NIVissimTLSignalGroup* NIVissimTL::myCurrentGroup [protected] |
Definition at line 138 of file NIVissimTL.h.
NIVissimTL::DictType NIVissimTL::myDict [static, private] |
Definition at line 142 of file NIVissimTL.h.
Referenced by clearDict(), dict_SetSignals(), and dictionary().
int NIVissimTL::myID [protected] |
std::string NIVissimTL::myName [protected] |
Definition at line 135 of file NIVissimTL.h.
SUMOTime NIVissimTL::myOffset [protected] |
Definition at line 137 of file NIVissimTL.h.
std::string NIVissimTL::myType [protected] |
1.5.6