 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
33 {}, {}, {}, {}, {}, {}),
44 const std::vector<std::string>& vehicleTypes,
const std::string& name,
SUMOTime timeThreshold,
double speedThreshold,
47 {}, {}, {}, {}, {}, {}),
52 myVehicleTypes(vehicleTypes),
53 myTimeThreshold(timeThreshold),
54 mySpeedThreshold(speedThreshold) {
56 updateCenteringBoundary(
false);
107 access->writeAdditional(device);
250 return canParse<Position>(value);
255 return (canParse<double>(value) && (parse<double>(value) >= 0));
268 return canParse<SUMOTime>(value);
270 return canParse<double>(value) && (parse<double>(value) >= 0);
272 return canParse<bool>(value);
294 if (numEntrys == 0) {
301 return ((numEntrys != 0) && (numExits != 0));
328 entryExit->setMicrosimID(
getID());
334 if (
getID().size() > 0) {
361 if (parse<bool>(value)) {
static bool isValidAttribute(const std::string &value)
whether the given string is a valid attribute for a certain key (for example, a name)
void removeGLObjectFromGrid(GNEAttributeCarrier *AC)
add GL Object into net
std::string getParametersStr(const std::string kvsep="=", const std::string sep="|") const
Returns the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN".
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
#define SUMOTime_MAX_PERIOD
An Element which don't belong to GNENet but has influence in the simulation.
@ SUMO_ATTR_HALTING_SPEED_THRESHOLD
bool checkChildAdditionalRestriction() const
check restriction with the number of children
const std::string getID() const
get ID (all Attribute Carriers have one)
#define WRITE_WARNING(msg)
An upper class for objects with additional parameters.
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
static bool isValidFilename(const std::string &value)
whether the given string is a valid attribute for a filename (for example, a name)
Static storage of an output device and its base (abstract) implementation.
const GNETagProperties & myTagProperty
reference to tagProperty associated with this attribute carrier
GUIGeometry myAdditionalGeometry
geometry to be precomputed in updateGeometry(...)
A NBNetBuilder extended by visualisation and editing capabilities.
const PositionVector & getShape() const
The shape of the additional element.
const Parameterised::Map & getParametersMap() const
Returns the inner key/value map.
void updateGeometry()
update pre-computed geometry information
Position myPosition
position of E3 in view
static bool areParametersValid(const std::string &value, bool report=false, const std::string kvsep="=", const std::string sep="|")
check if given string can be parsed to a parameters map "key1=value1|key2=value2|....
double mySpeedThreshold
The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting.
std::map< std::string, std::string > Map
parameters map
static const RGBColor connectionColor
connection color
@ SUMO_TAG_DET_ENTRY
an e3 entry point
const std::string & getTagStr() const
get Tag vinculated with this attribute Property in String Format (used to avoid multiple calls to toS...
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
void writeParams(OutputDevice &device) const
write Params in the given outputdevice
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
GNENet * myNet
pointer to net
GNEDetectorE3(GNENet *net)
default constructor
friend class GNEChange_Attribute
declare friend class
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
std::string getParentName() const
Returns the name of the parent object (if any)
virtual void setMicrosimID(const std::string &newID)
Changes the microsimID of the object.
bool isValidDetectorID(const std::string &newID) const
check if a new detector ID is valid
SUMOTime myPeriod
period of E3 detector
void writeAdditional(OutputDevice &device) const
write additional element into a xml file
GUIVisualizationDetectorSettings detectorSettings
Detector settings.
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
double getAttributeDouble(SumoXMLAttr key) const
SUMOTime myTimeThreshold
The time-based threshold that describes how much time has to pass until a vehicle is recognized as ha...
void changeAttribute(GNEChange_Attribute *change)
special method for change attributes, avoid empty changes, always execute
static std::string escapeXML(const std::string &orig, const bool maskDoubleHyphen=false)
Replaces the standard escapes by their XML entities.
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
GUIVisualizationAdditionalSettings additionalSettings
Additional settings.
void setParametersStr(const std::string ¶msString, const std::string kvsep="=", const std::string sep="|")
set the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN"
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their correspondent attribute are valids
A point in 2D or 3D with translation and scaling methods.
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
std::string time2string(SUMOTime t)
convert SUMOTime to string
void drawParentChildLines(const GUIVisualizationSettings &s, const RGBColor &color, const bool onlySymbols=false) const
draw parent and child lines
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
std::vector< std::string > myVehicleTypes
attribute vehicle types
std::string myAdditionalName
name of additional
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
void addGLObjectIntoGrid(GNEAttributeCarrier *AC)
add GL Object into net
const Parameterised::Map & getACParametersMap() const
get parameters map
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
void drawSquaredAdditional(const GUIVisualizationSettings &s, const Position &pos, const double size, GUITexture texture, GUITexture selectedTexture) const
draw squared additional
GNEMoveOperation * getMoveOperation()
get move operation
Boundary myAdditionalBoundary
Additional Boundary.
@ GLO_E3DETECTOR
a E3 detector
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static const double E3Size
E3 detector size.
@ SUMO_ATTR_HALTING_TIME_THRESHOLD
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
const std::vector< GNEAdditional * > & getChildAdditionals() const
return child additionals
PositionVector shapeToUpdate
shape to update (edited in moveElement)
std::string myFilename
fielname of E3 detector
void selectAttributeCarrier(const bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
@ SUMO_TAG_E3DETECTOR
an e3 detector
void begin(GUIIcon icon, const std::string &description)
Begin undo command sub-group with current supermode. This begins a new group of commands that are tre...
@ GNE_ATTR_SELECTED
element is selected
Boundary & grow(double by)
extends the boundary by the given amount
const std::string & getDefaultValue(SumoXMLAttr attr) const
return the default value of the attribute of an element
const std::string & getTagStr() const
get tag assigned to this object in string format
static bool isValidListOfTypeID(const std::string &value)
whether the given string is a valid list of ids for an edge or vehicle type (empty aren't allowed)
Stores the information about how to visualize structures.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
void unselectAttributeCarrier(const bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
@ SUMO_TAG_DET_EXIT
an e3 exit point
void updateSinglePosGeometry(const Position &position, const double rotation)
update position and rotation
~GNEDetectorE3()
GNEDetectorE3 Destructor.
std::string getAttribute(SumoXMLAttr key) const
Position getPositionInView() const
Returns position of additional in view.