SUMO - Simulation of Urban MObility

MSNoLogicJunction.cpp

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