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