MSLogicJunction Class Reference

#include <MSLogicJunction.h>

Inheritance diagram for MSLogicJunction:

MSJunction MSRightOfWayJunction

Detailed Description

A junction which may not let all vehicles through, but must perform any kind of an operation to determine which cars are allowed to drive in this step.

Definition at line 53 of file MSLogicJunction.h.


Public Types

typedef std::bitset< 64 > InnerState
 Container for junction-internal lane occupation Each element of this container represents one particular junction-internal lane.
typedef std::vector
< ApproachingVehicleInformation
LinkApproachingVehicles
typedef std::bitset< 64 > LinkFoes
 Container for link foes.
typedef std::bitset< 64 > Request
 Container for vehicle requests. Each element of this container represents one particular link from one lane to another.
typedef std::bitset< 64 > Respond
 Container for the request responds. The respond is link-bound.

Public Member Functions

virtual bool clearRequests ()=0
virtual const std::vector
< MSLane * > & 
getFoeInternalLanes (const MSLink *const srcLink) const throw ()
virtual const std::vector
< MSLink * > & 
getFoeLinks (const MSLink *const srcLink) const throw ()
const std::string & getID () const
 Returns the id of the junction.
const Position2DgetPosition () const
const Position2DVectorgetShape () const throw ()
 Returns this junction's shape.
virtual void postloadInit () throw (ProcessError)
 initialises the junction after the whole net has been loaded
virtual bool setAllowed ()=0
 Sets the responds.
virtual ~MSLogicJunction ()
 Destructor.

Protected Member Functions

 MSLogicJunction (const std::string &id, const Position2D &position, const Position2DVector &shape, std::vector< MSLane * > incoming) throw ()
 Constructor.

Protected Attributes

std::vector< MSLane * > myEmptyLanes
std::vector< MSLink * > myEmptyLinks
std::string myID
 The id of the junction.
std::vector< MSLane * > myIncomingLanes
 list of incoming lanes
InnerState myInnerState
Position2D myPosition
 The position of the junction.
Request myRequest
Respond myRespond
Position2DVector myShape
 The shape of the junction.

Private Member Functions

 MSLogicJunction (const MSLogicJunction &)
 Invalidated copy constructor.
MSLogicJunctionoperator= (const MSLogicJunction &)
 Invalidated assignment operator.

Member Typedef Documentation

typedef std::bitset<64> MSLogicJunction::InnerState

Container for junction-internal lane occupation Each element of this container represents one particular junction-internal lane.

Definition at line 75 of file MSLogicJunction.h.

Definition at line 62 of file MSJunction.h.

typedef std::bitset<64> MSLogicJunction::LinkFoes

Container for link foes.

Definition at line 70 of file MSLogicJunction.h.

typedef std::bitset<64> MSLogicJunction::Request

Container for vehicle requests. Each element of this container represents one particular link from one lane to another.

Definition at line 63 of file MSLogicJunction.h.

typedef std::bitset<64> MSLogicJunction::Respond

Container for the request responds. The respond is link-bound.

Definition at line 67 of file MSLogicJunction.h.


Constructor & Destructor Documentation

MSLogicJunction::~MSLogicJunction (  )  [virtual]

Destructor.

Definition at line 61 of file MSLogicJunction.cpp.

00061 {}

MSLogicJunction::MSLogicJunction ( const std::string &  id,
const Position2D position,
const Position2DVector shape,
std::vector< MSLane * >  incoming 
) throw () [protected]

Constructor.

Parameters:
[in] id The id of the junction
[in] position The position of the junction
[in] shape The shape of the junction
[in] incoming The incoming lanes
[in] internal The internal lanes

Definition at line 45 of file MSLogicJunction.cpp.

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) {}

MSLogicJunction::MSLogicJunction ( const MSLogicJunction  )  [private]

Invalidated copy constructor.


Member Function Documentation

virtual bool MSJunction::clearRequests (  )  [pure virtual, inherited]

Clears junction's and lane's requests to prepare for the next iteration.

Implemented in MSNoLogicJunction, and MSRightOfWayJunction.

Referenced by MSJunctionControl::resetRequests().

virtual const std::vector<MSLane*>& MSJunction::getFoeInternalLanes ( const MSLink *const   srcLink  )  const throw () [inline, virtual, inherited]

Reimplemented in MSRightOfWayJunction.

Definition at line 116 of file MSJunction.h.

References MSJunction::myEmptyLanes.

00116                                                                                                      {
00117         return myEmptyLanes;
00118     }

virtual const std::vector<MSLink*>& MSJunction::getFoeLinks ( const MSLink *const   srcLink  )  const throw () [inline, virtual, inherited]

Reimplemented in MSRightOfWayJunction.

Definition at line 112 of file MSJunction.h.

References MSJunction::myEmptyLinks.

00112                                                                                              {
00113         return myEmptyLinks;
00114     }

const std::string & MSJunction::getID (  )  const [inherited]

Returns the id of the junction.

Definition at line 65 of file MSJunction.cpp.

References MSJunction::myID.

Referenced by GUIJunctionWrapper::getMicrosimID().

00065                         {
00066     return myID;
00067 }

const Position2D & MSJunction::getPosition (  )  const [inherited]

returns the junction's position

Definition at line 55 of file MSJunction.cpp.

References MSJunction::myPosition.

Referenced by GUIJunctionWrapper::drawGL(), GUINet::getJunctionPosition(), traci::TraCIServer::handleTrafficLightDomain(), and TraCIServerAPI_Junction::processGet().

00055                               {
00056     return myPosition;
00057 }

const Position2DVector& MSJunction::getShape (  )  const throw () [inline, inherited]

Returns this junction's shape.

Returns:
The shape of this junction

Definition at line 108 of file MSJunction.h.

References MSJunction::myShape.

Referenced by GUIJunctionWrapper::drawGL().

00108                                                      {
00109         return myShape;
00110     }

MSLogicJunction& MSLogicJunction::operator= ( const MSLogicJunction  )  [private]

Invalidated assignment operator.

void MSLogicJunction::postloadInit (  )  throw (ProcessError) [virtual]

initialises the junction after the whole net has been loaded

Reimplemented from MSJunction.

Reimplemented in MSRightOfWayJunction.

Definition at line 65 of file MSLogicJunction.cpp.

00065                                                   {
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 }

virtual bool MSJunction::setAllowed (  )  [pure virtual, inherited]

Sets the responds.

Implemented in MSNoLogicJunction, and MSRightOfWayJunction.

Referenced by MSJunctionControl::setAllowed().


Field Documentation

std::vector<MSLane*> MSJunction::myEmptyLanes [protected, inherited]

Definition at line 131 of file MSJunction.h.

Referenced by MSJunction::getFoeInternalLanes().

std::vector<MSLink*> MSJunction::myEmptyLinks [protected, inherited]

Definition at line 130 of file MSJunction.h.

Referenced by MSJunction::getFoeLinks().

std::string MSJunction::myID [protected, inherited]

The id of the junction.

Definition at line 122 of file MSJunction.h.

Referenced by MSJunction::getID().

std::vector<MSLane*> MSLogicJunction::myIncomingLanes [protected]

list of incoming lanes

Definition at line 98 of file MSLogicJunction.h.

Referenced by MSRightOfWayJunction::postloadInit().

Position2D MSJunction::myPosition [protected, inherited]

The position of the junction.

Definition at line 125 of file MSJunction.h.

Referenced by MSJunction::getPosition().

Position2DVector MSJunction::myShape [protected, inherited]

The shape of the junction.

Definition at line 128 of file MSJunction.h.

Referenced by MSJunction::getShape().


The documentation for this class was generated from the following files:

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