SUMO - Simulation of Urban MObility
MSNoLogicJunction.cpp
Go to the documentation of this file.
00001 /****************************************************************************/
00008 // -------------------
00009 /****************************************************************************/
00010 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00011 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
00012 /****************************************************************************/
00013 //
00014 //   This file is part of SUMO.
00015 //   SUMO is free software: you can redistribute it and/or modify
00016 //   it under the terms of the GNU General Public License as published by
00017 //   the Free Software Foundation, either version 3 of the License, or
00018 //   (at your option) any later version.
00019 //
00020 /****************************************************************************/
00021 
00022 
00023 // ===========================================================================
00024 // included modules
00025 // ===========================================================================
00026 #ifdef _MSC_VER
00027 #include <windows_config.h>
00028 #else
00029 #include <config.h>
00030 #endif
00031 
00032 #include "MSNoLogicJunction.h"
00033 #include "MSLane.h"
00034 #include "MSInternalLane.h"
00035 #include <algorithm>
00036 #include <cassert>
00037 #include <cmath>
00038 
00039 #ifdef CHECK_MEMORY_LEAKS
00040 #include <foreign/nvwa/debug_new.h>
00041 #endif // CHECK_MEMORY_LEAKS
00042 
00043 
00044 // ===========================================================================
00045 // static member definitions
00046 // ===========================================================================
00047 std::bitset<64> MSNoLogicJunction::myDump((unsigned long long) 0xffffffff);
00048 
00049 
00050 
00051 // ===========================================================================
00052 // method definitions
00053 // ===========================================================================
00054 MSNoLogicJunction::MSNoLogicJunction(const std::string& id,
00055                                      const Position& position,
00056                                      const PositionVector& shape,
00057                                      std::vector<MSLane*> incoming
00058 #ifdef HAVE_INTERNAL_LANES
00059                                      , std::vector<MSLane*> internal
00060 #endif
00061                                     )
00062     : MSJunction(id, position, shape),
00063       myIncomingLanes(incoming)
00064 #ifdef HAVE_INTERNAL_LANES
00065       , myInternalLanes(internal)
00066 #endif
00067 {
00068 }
00069 
00070 
00071 MSNoLogicJunction::~MSNoLogicJunction() {}
00072 
00073 
00074 void
00075 MSNoLogicJunction::postloadInit() {
00076     std::vector<MSLane*>::iterator i;
00077     // inform links where they have to report approaching vehicles to
00078     for (i = myIncomingLanes.begin(); i != myIncomingLanes.end(); ++i) {
00079         const MSLinkCont& links = (*i)->getLinkCont();
00080         for (MSLinkCont::const_iterator j = links.begin(); j != links.end(); j++) {
00081             (*j)->setRequestInformation(0, 0, false, false, std::vector<MSLink*>(), std::vector<MSLane*>());
00082         }
00083     }
00084 #ifdef HAVE_INTERNAL_LANES
00085     // set information for the internal lanes
00086     for (i = myInternalLanes.begin(); i != myInternalLanes.end(); ++i) {
00087         // ... set information about participation
00088         static_cast<MSInternalLane*>(*i)->setParentJunctionInformation(&myDump, 0);
00089     }
00090 #endif
00091 }
00092 
00093 
00094 
00095 /****************************************************************************/
00096 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines