MSInternalLane.cpp

Go to the documentation of this file.
00001 /****************************************************************************/
00007 // Representation of a lane over a junction
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 <utils/common/UtilExceptions.h>
00030 #include <utils/common/StdDefs.h>
00031 #include "MSEdge.h"
00032 #include "MSJunction.h"
00033 #include "MSLogicJunction.h"
00034 #include "MSLink.h"
00035 #include "MSInternalLane.h"
00036 #include <cmath>
00037 #include <bitset>
00038 #include <iostream>
00039 #include <cassert>
00040 #include <functional>
00041 #include <algorithm>
00042 #include <iterator>
00043 #include <exception>
00044 #include <climits>
00045 #include <utils/common/MsgHandler.h>
00046 #include <utils/common/ToString.h>
00047 #include <utils/options/OptionsCont.h>
00048 
00049 #ifdef CHECK_MEMORY_LEAKS
00050 #include <foreign/nvwa/debug_new.h>
00051 #endif // CHECK_MEMORY_LEAKS
00052 
00053 
00054 // ===========================================================================
00055 // member method definitions
00056 // ===========================================================================
00057 MSInternalLane::MSInternalLane(const std::string &id, SUMOReal maxSpeed,
00058                                SUMOReal length, MSEdge * const edge, unsigned int numericalID,
00059                                const Position2DVector &shape,
00060                                const std::vector<SUMOVehicleClass> &allowed,
00061                                const std::vector<SUMOVehicleClass> &disallowed) throw()
00062         : MSLane(id, maxSpeed, length, edge, numericalID, shape, allowed, disallowed),
00063         myFoesIndex(-1) {}
00064 
00065 
00066 MSInternalLane::~MSInternalLane() throw() {}
00067 
00068 
00069 void
00070 MSInternalLane::setParentJunctionInformation(MSLogicJunction::InnerState * const foescont,
00071         unsigned int foesIdx) throw() {
00072     myFoesCont = foescont;
00073     myFoesIndex = (int) foesIdx;
00074 }
00075 
00076 
00077 void
00078 MSInternalLane::setPassPosition(SUMOReal passPos) throw() {
00079     myPassPosition = passPos;
00080 }
00081 
00082 
00083 bool
00084 MSInternalLane::moveCritical(SUMOTime t) {
00085     assert(myVehicles.size()>0);
00086     if (myFoesIndex>=0) {
00087         (*myFoesCont)[myFoesIndex] = true;
00088     }
00089     return MSLane::moveCritical(t);
00090 }
00091 
00092 
00093 /****************************************************************************/
00094 

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