Eclipse SUMO - Simulation of Urban MObility
MSBitSetLogic< N > Class Template Reference

#include <MSBitSetLogic.h>

Inheritance diagram for MSBitSetLogic< N >:
Collaboration diagram for MSBitSetLogic< N >:

Public Types

typedef std::vector< std::bitset< N > > Foes
 Container holding the information which internal lanes prohibt which links Build the same way as Logic. More...
 
typedef std::vector< std::bitset< N > > Logic
 Container that holds the right of way bitsets. Each link has it's own bitset. The bits in the bitsets correspond to the links. To create a bitset for a particular link, set the bits to true that correspond to links that have the right of way. All others set to false, including the link's "own" link-bit. More...
 

Public Member Functions

const MSLogicJunction::LinkBitsgetFoesFor (int linkIndex) const
 Returns the foes for the given link. More...
 
bool getIsCont (int linkIndex) const
 
int getLogicSize () const
 
const MSLogicJunction::LinkBitsgetResponseFor (int linkIndex) const
 Returns the response for the given link. More...
 
virtual bool hasFoes () const
 
 MSBitSetLogic (int nLinks, Logic *logic, Foes *foes, std::bitset< SUMO_MAX_CONNECTIONS > conts)
 Use this constructor only. More...
 
int nLinks ()
 Returns the logic's number of links. More...
 
 ~MSBitSetLogic ()
 Destructor. More...
 

Protected Attributes

int myNLinks
 The logic's number of links. More...
 

Static Protected Attributes

static MSLogicJunction::LinkBits myDummyFoes
 A dummy foe container. More...
 

Private Member Functions

 MSBitSetLogic (const MSBitSetLogic &)
 Invalidated copy constructor. More...
 
MSBitSetLogicoperator= (const MSBitSetLogic &)
 Invalidated assignment operator. More...
 

Private Attributes

std::bitset< SUMO_MAX_CONNECTIONSmyConts
 
FoesmyInternalLinksFoes
 internal lanes logic More...
 
LogicmyLogic
 junctions logic based on std::bitset More...
 

Detailed Description

template<int N>
class MSBitSetLogic< N >

N is sum of the number of links of the junction's inLanes.

Definition at line 44 of file MSBitSetLogic.h.

Member Typedef Documentation

◆ Foes

template<int N>
typedef std::vector< std::bitset< N > > MSBitSetLogic< N >::Foes

Container holding the information which internal lanes prohibt which links Build the same way as Logic.

Definition at line 56 of file MSBitSetLogic.h.

◆ Logic

template<int N>
typedef std::vector< std::bitset< N > > MSBitSetLogic< N >::Logic

Container that holds the right of way bitsets. Each link has it's own bitset. The bits in the bitsets correspond to the links. To create a bitset for a particular link, set the bits to true that correspond to links that have the right of way. All others set to false, including the link's "own" link-bit.

Definition at line 52 of file MSBitSetLogic.h.

Constructor & Destructor Documentation

◆ MSBitSetLogic() [1/2]

template<int N>
MSBitSetLogic< N >::MSBitSetLogic ( int  nLinks,
Logic logic,
Foes foes,
std::bitset< SUMO_MAX_CONNECTIONS conts 
)
inline

Use this constructor only.

Definition at line 61 of file MSBitSetLogic.h.

◆ ~MSBitSetLogic()

template<int N>
MSBitSetLogic< N >::~MSBitSetLogic ( )
inline

Destructor.

Definition at line 70 of file MSBitSetLogic.h.

References MSBitSetLogic< N >::myInternalLinksFoes, and MSBitSetLogic< N >::myLogic.

◆ MSBitSetLogic() [2/2]

template<int N>
MSBitSetLogic< N >::MSBitSetLogic ( const MSBitSetLogic< N > &  )
private

Invalidated copy constructor.

Member Function Documentation

◆ getFoesFor()

template<int N>
const MSLogicJunction::LinkBits& MSBitSetLogic< N >::getFoesFor ( int  linkIndex) const
inlinevirtual

Returns the foes for the given link.

Reimplemented from MSJunctionLogic.

Definition at line 82 of file MSBitSetLogic.h.

References MSBitSetLogic< N >::myInternalLinksFoes.

◆ getIsCont()

template<int N>
bool MSBitSetLogic< N >::getIsCont ( int  linkIndex) const
inlinevirtual

Reimplemented from MSJunctionLogic.

Definition at line 86 of file MSBitSetLogic.h.

References MSBitSetLogic< N >::myConts.

◆ getLogicSize()

int MSJunctionLogic::getLogicSize ( ) const
inlineinherited

Definition at line 64 of file MSJunctionLogic.h.

References MSJunctionLogic::myNLinks.

Referenced by MSRightOfWayJunction::postloadInit().

◆ getResponseFor()

template<int N>
const MSLogicJunction::LinkBits& MSBitSetLogic< N >::getResponseFor ( int  linkIndex) const
inlinevirtual

Returns the response for the given link.

Reimplemented from MSJunctionLogic.

Definition at line 77 of file MSBitSetLogic.h.

References MSBitSetLogic< N >::myLogic.

◆ hasFoes()

template<int N>
virtual bool MSBitSetLogic< N >::hasFoes ( ) const
inlinevirtual

Reimplemented from MSJunctionLogic.

Definition at line 90 of file MSBitSetLogic.h.

References MSBitSetLogic< N >::myLogic.

◆ nLinks()

int MSJunctionLogic::nLinks ( )
inherited

Returns the logic's number of links.

Definition at line 39 of file MSJunctionLogic.cpp.

References MSJunctionLogic::myNLinks.

◆ operator=()

template<int N>
MSBitSetLogic& MSBitSetLogic< N >::operator= ( const MSBitSetLogic< N > &  )
private

Invalidated assignment operator.

Field Documentation

◆ myConts

template<int N>
std::bitset<SUMO_MAX_CONNECTIONS> MSBitSetLogic< N >::myConts
private

Definition at line 106 of file MSBitSetLogic.h.

Referenced by MSBitSetLogic< N >::getIsCont().

◆ myDummyFoes

MSLogicJunction::LinkBits MSJunctionLogic::myDummyFoes
staticprotectedinherited

A dummy foe container.

Definition at line 83 of file MSJunctionLogic.h.

Referenced by MSJunctionLogic::getFoesFor(), and MSJunctionLogic::getResponseFor().

◆ myInternalLinksFoes

template<int N>
Foes* MSBitSetLogic< N >::myInternalLinksFoes
private

internal lanes logic

Definition at line 104 of file MSBitSetLogic.h.

Referenced by MSBitSetLogic< N >::getFoesFor(), and MSBitSetLogic< N >::~MSBitSetLogic().

◆ myLogic

template<int N>
Logic* MSBitSetLogic< N >::myLogic
private

junctions logic based on std::bitset

Definition at line 101 of file MSBitSetLogic.h.

Referenced by MSBitSetLogic< N >::getResponseFor(), MSBitSetLogic< N >::hasFoes(), and MSBitSetLogic< N >::~MSBitSetLogic().

◆ myNLinks

int MSJunctionLogic::myNLinks
protectedinherited

The logic's number of links.

Definition at line 80 of file MSJunctionLogic.h.

Referenced by MSJunctionLogic::getLogicSize(), and MSJunctionLogic::nLinks().


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