SUMO - Simulation of Urban MObility
MSLogicJunction.cpp
Go to the documentation of this file.
00001 /****************************************************************************/
00009 // with one ore more logics.
00010 /****************************************************************************/
00011 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00012 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
00013 /****************************************************************************/
00014 //
00015 //   This file is part of SUMO.
00016 //   SUMO is free software: you can redistribute it and/or modify
00017 //   it under the terms of the GNU General Public License as published by
00018 //   the Free Software Foundation, either version 3 of the License, or
00019 //   (at your option) any later version.
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 "MSLinkCont.h"
00033 #include "MSLogicJunction.h"
00034 #include "MSLane.h"
00035 #include "MSInternalLane.h"
00036 
00037 #ifdef CHECK_MEMORY_LEAKS
00038 #include <foreign/nvwa/debug_new.h>
00039 #endif // CHECK_MEMORY_LEAKS
00040 
00041 
00042 // ===========================================================================
00043 // member method definitions
00044 // ===========================================================================
00045 /* -------------------------------------------------------------------------
00046  * methods from MSLogicJunction
00047  * ----------------------------------------------------------------------- */
00048 MSLogicJunction::MSLogicJunction(const std::string& id,
00049                                  const Position& position,
00050                                  const PositionVector& shape,
00051                                  std::vector<MSLane*> incoming
00052 #ifdef HAVE_INTERNAL_LANES
00053                                  , std::vector<MSLane*> internal
00054 #endif
00055                                 )
00056     : MSJunction(id, position, shape),
00057       myIncomingLanes(incoming),
00058 #ifdef HAVE_INTERNAL_LANES
00059       myInternalLanes(internal),
00060 #endif
00061       myInnerState(false) {}
00062 
00063 
00064 MSLogicJunction::~MSLogicJunction() {}
00065 
00066 
00067 void
00068 MSLogicJunction::postloadInit() {
00069     /*
00070     if(getID()=="1565") {
00071         int bla = 0;
00072     }
00073     // inform links where they have to report approaching vehicles to
00074     size_t requestPos = 0;
00075     std::vector<MSLane*>::iterator i;
00076     // going through the incoming lanes...
00077     for(i=myIncomingLanes.begin(); i!=myIncomingLanes.end(); ++i) {
00078         const MSLinkCont &links = (*i)->getLinkCont();
00079         // ... set information for every link
00080         for(MSLinkCont::const_iterator j=links.begin(); j!=links.end(); j++) {
00081             (*j)->setRequestInformation(&myRequest, requestPos,
00082                 &myRespond, requestPos/, clearInfo/);
00083             requestPos++;
00084         }
00085     }
00086     #ifdef HAVE_INTERNAL_LANES
00087     // set information for the internal lanes
00088     requestPos = 0;
00089     for(i=myInternalLanes.begin(); i!=myInternalLanes.end(); ++i) {
00090         // ... set information about participation
00091         static_cast<MSInternalLane*>(*i)->setParentJunctionInformation(
00092             &myInnerState, requestPos++);
00093     }
00094     #endif
00095     */
00096 }
00097 
00098 
00099 
00100 /****************************************************************************/
00101 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines