50 const double length,
const double exaggeration)
const {
52 const double contourWidth = (0.05 * exaggeration);
58 glRotated(rotation, 0, 0, -1);
59 glTranslated(-1 * ((width * 0.5 * exaggeration) + (0.35 * exaggeration)) - 0.05, 0, 0);
64 glTranslated(0, 0, 0.1);
116 return "containerTriggered";
150 return "invalid terminate";
166 return "invalid flow spacing";
221 return error.empty();
224 if (GNEAttributeCarrier::canParse<SUMOTime>(value)) {
225 return (GNEAttributeCarrier::parse<SUMOTime>(value) >= 0);
234 if (GNEAttributeCarrier::canParse<double>(value)) {
235 return (GNEAttributeCarrier::parse<double>(value) > 0);
240 if (GNEAttributeCarrier::canParse<double>(value)) {
241 const double prob = GNEAttributeCarrier::parse<double>(value);
242 return ((prob >= 0) && (prob <= 1));
247 if (GNEAttributeCarrier::canParse<int>(value)) {
248 return (GNEAttributeCarrier::parse<int>(value) >= 0);
255 if (std::find(flowValues.begin(), flowValues.end(), value) != flowValues.end()) {
347 poissonRate = GNEAttributeCarrier::parse<double>(value) / 3600;
354 poissonRate = GNEAttributeCarrier::parse<double>(value);
509 auto valueStr =
toString(value, 20);
511 while (valueStr.size() > 1) {
512 if (valueStr.back() ==
'0') {
514 }
else if (valueStr.back() ==
'.') {
@ GLO_VEHICLELABELS
stack and flow labels (used in netedit)
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
std::string time2string(SUMOTime t, bool humanReadable)
convert SUMOTime to string (independently of global format setting)
const long long int VEHPARS_END_SET
const long long int VEHPARS_PERIOD_SET
const long long int VEHPARS_POISSON_SET
const long long int VEHPARS_PROB_SET
const long long int VEHPARS_VPH_SET
const long long int VEHPARS_NUMBER_SET
DepartDefinition
Possible ways to depart.
@ BEGIN
The departure is at simulation start.
@ NOW
The vehicle is discarded if emission fails (not fully implemented yet)
@ SPLIT
The departure is triggered by a train split.
@ CONTAINER_TRIGGERED
The departure is container triggered.
@ TRIGGERED
The departure is person triggered.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_BEGIN
weights: time range begin
@ GNE_ATTR_POISSON
poisson definition (used in flow)
@ SUMO_ATTR_CONTAINERSPERHOUR
@ SUMO_ATTR_END
weights: time range end
@ GNE_ATTR_FLOW_SPACING
flow spacing
@ GNE_ATTR_FLOW_TERMINATE
flow terminating
@ SUMO_ATTR_PERSONSPERHOUR
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
static void popMatrix()
pop matrix
static void drawBoxLine(const Position &beg, double rot, double visLength, double width, double offset=0)
Draws a thick line.
static void pushMatrix()
push matrix
static void drawText(const std::string &text, const Position &pos, const double layer, const double size, const RGBColor &col=RGBColor::BLACK, const double angle=0, const int align=0, double width=-1)
void setCommonAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
const std::string & getTagStr() const
get tag assigned to this object in string format
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
bool isCommonValid(SumoXMLAttr key, const std::string &value)
std::string getCommonAttribute(SumoXMLAttr key) const
const std::vector< std::string > & getDiscreteValues() const
get discrete values
static void changeAttribute(GNEAttributeCarrier *AC, SumoXMLAttr key, const std::string &value, GNEUndoList *undoList, const bool force=false)
change attribute
the function-object for an editing operation (abstract base)
void toggleFlowAttribute(const SumoXMLAttr attribute, const bool value)
toggle flow parameters (used in toggleAttribute(...) function of vehicles, persons and containers
~GNEDemandElementFlow()
destructor
void drawFlowLabel(const Position &position, const double rotation, const double width, const double length, const double exaggeration) const
draw flow label
std::string getFlowAttribute(const GNEDemandElement *flowElement, SumoXMLAttr key) const
inherited from GNEAttributeCarrier and adapted to GNEDemandElementFlow
void disableFlowAttribute(GNEDemandElement *flowElement, SumoXMLAttr key, GNEUndoList *undoList)
bool isFlowAttributeEnabled(SumoXMLAttr key) const
double getFlowAttributeDouble(SumoXMLAttr key) const
GNEDemandElementFlow(GNEDemandElement *flowElement)
constructor
bool isValidFlowAttribute(GNEDemandElement *flowElement, SumoXMLAttr key, const std::string &value)
void writeFlowAttributes(const GNEDemandElement *flowElement, OutputDevice &device) const
write flow attributes
std::string adjustDecimalValue(const double value) const
adjust decimal value
void enableFlowAttribute(GNEDemandElement *flowElement, SumoXMLAttr key, GNEUndoList *undoList)
void setFlowAttribute(GNEDemandElement *flowElement, SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
void setDefaultFlowAttributes(GNEDemandElement *flowElement)
set flow default attributes
bool isContainer() const
return true if tag correspond to a container element
bool isFlow() const
return true if tag correspond to a flow element
const std::string & getTagStr() const
get Tag vinculated with this attribute Property in String Format (used to avoid multiple calls to toS...
const GNEAttributeProperties & getAttributeProperties(SumoXMLAttr attr) const
get attribute propety associated with the given Sumo XML Attribute (throw error if doesn't exist)
const std::string & getDefaultValue(SumoXMLAttr attr) const
return the default value of the attribute of an element
bool hasAttribute(SumoXMLAttr attr) const
check if current TagProperties owns the attribute "attr"
bool isPerson() const
return true if tag correspond to a person element
void add(GNEChange *command, bool doit=false, bool merge=true)
Add new command, executing it if desired. The new command will be merged with the previous command if...
Static storage of an output device and its base (abstract) implementation.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
A point in 2D or 3D with translation and scaling methods.
double x() const
Returns the x-position.
double y() const
Returns the y-position.
static const RGBColor GREY
static const RGBColor CYAN
static const RGBColor BLACK
Structure representing possible vehicle parameter.
double repetitionProbability
The probability for emitting a vehicle per second.
SUMOTime repetitionOffset
The time offset between vehicle reinsertions.
long long int parametersSet
Information for the router which parameter were set, TraCI may modify this (when changing color)
double poissonRate
The rate for emitting vehicles with a poisson distribution.
SUMOTime repetitionEnd
The time at which the flow ends (only needed when using repetitionProbability)
static bool parseDepart(const std::string &val, const std::string &element, const std::string &id, SUMOTime &depart, DepartDefinition &dd, std::string &error, const std::string &attr="departure")
Validates a given depart value.
DepartDefinition departProcedure
Information how the vehicle shall choose the depart time.