MSLogicJunction.cpp

Go to the documentation of this file.
00001 /****************************************************************************/
00007 // with one ore more logics.
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 // included modules
00022 // ===========================================================================
00023 #ifdef _MSC_VER
00024 #include <windows_config.h>
00025 #else
00026 #include <config.h>
00027 #endif
00028 
00029 #include "MSLinkCont.h"
00030 #include "MSLogicJunction.h"
00031 #include "MSLane.h"
00032 #include "MSInternalLane.h"
00033 
00034 #ifdef CHECK_MEMORY_LEAKS
00035 #include <foreign/nvwa/debug_new.h>
00036 #endif // CHECK_MEMORY_LEAKS
00037 
00038 
00039 // ===========================================================================
00040 // member method definitions
00041 // ===========================================================================
00042 /* -------------------------------------------------------------------------
00043  * methods from MSLogicJunction
00044  * ----------------------------------------------------------------------- */
00045 MSLogicJunction::MSLogicJunction(const std::string &id,
00046                                  const Position2D &position,
00047                                  const Position2DVector &shape,
00048                                  std::vector<MSLane*> incoming
00049 #ifdef HAVE_INTERNAL_LANES
00050                                  , std::vector<MSLane*> internal
00051 #endif
00052                                 ) throw()
00053         : MSJunction(id, position, shape),
00054         myIncomingLanes(incoming),
00055 #ifdef HAVE_INTERNAL_LANES
00056         myInternalLanes(internal),
00057 #endif
00058         myRequest(false), myInnerState(false), myRespond(false) {}
00059 
00060 
00061 MSLogicJunction::~MSLogicJunction() {}
00062 
00063 
00064 void
00065 MSLogicJunction::postloadInit() throw(ProcessError) {
00066     /*
00067     if(getID()=="1565") {
00068         int bla = 0;
00069     }
00070     // inform links where they have to report approaching vehicles to
00071     size_t requestPos = 0;
00072     std::vector<MSLane*>::iterator i;
00073     // going through the incoming lanes...
00074     for(i=myIncomingLanes.begin(); i!=myIncomingLanes.end(); ++i) {
00075         const MSLinkCont &links = (*i)->getLinkCont();
00076         // ... set information for every link
00077         for(MSLinkCont::const_iterator j=links.begin(); j!=links.end(); j++) {
00078             (*j)->setRequestInformation(&myRequest, requestPos,
00079                 &myRespond, requestPos/, clearInfo/);
00080             requestPos++;
00081         }
00082     }
00083     #ifdef HAVE_INTERNAL_LANES
00084     // set information for the internal lanes
00085     requestPos = 0;
00086     for(i=myInternalLanes.begin(); i!=myInternalLanes.end(); ++i) {
00087         // ... set information about participation
00088         static_cast<MSInternalLane*>(*i)->setParentJunctionInformation(
00089             &myInnerState, requestPos++);
00090     }
00091     #endif
00092     */
00093 }
00094 
00095 
00096 
00097 /****************************************************************************/
00098 

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