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 2001-2010 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) 0xffffffff);
00046 
00047 
00048 
00049 // ===========================================================================
00050 // method definitions
00051 // ===========================================================================
00052 MSNoLogicJunction::MSNoLogicJunction(const std::string &id,
00053                                      const Position2D &position,
00054                                      const Position2DVector &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 bool
00070 MSNoLogicJunction::clearRequests() {
00071     return true;
00072 }
00073 
00074 //-------------------------------------------------------------------------//
00075 
00076 MSNoLogicJunction::~MSNoLogicJunction() {}
00077 
00078 //-------------------------------------------------------------------------//
00079 
00080 void
00081 MSNoLogicJunction::postloadInit() throw(ProcessError) {
00082     std::vector<MSLane*>::iterator i;
00083     // inform links where they have to report approaching vehicles to
00084     for (i=myIncomingLanes.begin(); i!=myIncomingLanes.end(); ++i) {
00085         const MSLinkCont &links = (*i)->getLinkCont();
00086         for (MSLinkCont::const_iterator j=links.begin(); j!=links.end(); j++) {
00087             (*j)->setRequestInformation(&myDump, 0, &myDump, 0, MSLogicJunction::LinkFoes(), false, false,
00088                                         std::vector<MSLink*>(), std::vector<MSLane*>());
00089         }
00090     }
00091 #ifdef HAVE_INTERNAL_LANES
00092     // set information for the internal lanes
00093     for (i=myInternalLanes.begin(); i!=myInternalLanes.end(); ++i) {
00094         // ... set information about participation
00095         static_cast<MSInternalLane*>(*i)->setParentJunctionInformation(&myDump, 0);
00096     }
00097 #endif
00098 }
00099 
00100 
00101 
00102 /****************************************************************************/
00103 

Generated on Wed May 5 00:06:32 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6