62 myCalibratorParent(calibratorParent), myFlowID(calibratorParent->generateFlowID()), myVehicleType(
""), myRoute(
""), myColor(
""), myDepartLane(
"first"),
63 myDepartPos(
"base"), myDepartSpeed(
"0"), myArrivalLane(
"current"), myArrivalPos(
"max"), myArrivalSpeed(
"current"),
64 myLine(
""), myPersonNumber(0), myContainerNumber(0), myReroute(false), myDepartPosLat(
"center"), myArrivalPosLat(
""),
65 myBegin(0), myEnd(0), myVehsPerHour(0), myPeriod(0), myProbability(0), myNumber(0), myTypeOfFlow(GNE_CALIBRATORFLOW_VEHSPERHOUR) {
76 std::string color, std::string departLane, std::string departPos, std::string departSpeed, std::string arrivalLane, std::string arrivalPos,
77 std::string arrivalSpeed, std::string line,
int personNumber,
int containerNumber,
bool reroute, std::string departPosLat,
78 std::string arrivalPosLat,
double begin,
double end,
double vehsPerHour,
double period,
double probability,
int number) :
264 if (flowID.empty()) {
277 if (vehicleType.empty()) {
310 int departLaneInt = -1;
311 if (GNEAttributeCarrier::canParse<int>(departLane)) {
312 departLaneInt = GNEAttributeCarrier::parse<int>(departLane);
314 if ((departLaneInt < 0) && (departLane !=
"random") && (departLane !=
"free") &&
315 (departLane !=
"allowed") && (departLane !=
"best") && (departLane !=
"first")) {
326 double departPosFloat = -1;
327 if (GNEAttributeCarrier::canParse<double>(departPos)) {
328 departPosFloat = GNEAttributeCarrier::parse<double>(departPos);
330 if ((departPosFloat < 0) && (departPos !=
"random") && (departPos !=
"free") &&
331 (departPos !=
"random_free") && (departPos !=
"base") && (departPos !=
"last")) {
342 double departSpeedDouble = -1;
343 if (GNEAttributeCarrier::canParse<double>(departSpeed)) {
344 departSpeedDouble = GNEAttributeCarrier::parse<double>(departSpeed);
346 if ((departSpeedDouble < 0) && (departSpeed !=
"random") && (departSpeed !=
"max")) {
357 int arrivalLaneInt = -1;
358 if (GNEAttributeCarrier::canParse<int>(arrivalLane)) {
359 arrivalLaneInt = GNEAttributeCarrier::parse<int>(arrivalLane);
361 if ((arrivalLaneInt < 0) && (arrivalLane !=
"current")) {
372 double arrivalPosFloat = -1;
373 if (GNEAttributeCarrier::canParse<double>(arrivalPos)) {
374 arrivalPosFloat = GNEAttributeCarrier::parse<double>(arrivalPos);
376 if ((arrivalPosFloat < 0) && (arrivalPos !=
"random") && (arrivalPos !=
"max")) {
387 double arrivalSpeedDouble = -1;
388 if (GNEAttributeCarrier::canParse<double>(arrivalSpeed)) {
389 arrivalSpeedDouble = GNEAttributeCarrier::parse<double>(arrivalSpeed);
391 if ((arrivalSpeedDouble < 0) && (arrivalSpeed !=
"current")) {
409 if (personNumber < 0) {
420 if (GNEAttributeCarrier::canParse<int>(personNumber)) {
422 }
else if (GNEAttributeCarrier::canParse<double>(personNumber)) {
423 double personNumberDouble = GNEAttributeCarrier::parse<double>(personNumber);
425 if (fmod(personNumberDouble, 1) == 0) {
438 if (containerNumber < 0) {
449 if (GNEAttributeCarrier::canParse<int>(ContainerNumber)) {
451 }
else if (GNEAttributeCarrier::canParse<double>(ContainerNumber)) {
452 double ContainerNumberDouble = GNEAttributeCarrier::parse<double>(ContainerNumber);
454 if (fmod(ContainerNumberDouble, 1) == 0) {
474 if (GNEAttributeCarrier::canParse<bool>(value)) {
475 return setReroute(GNEAttributeCarrier::parse<bool>(value));
484 double departPosLatFloat = -1;
485 if (GNEAttributeCarrier::canParse<double>(departPosLat)) {
486 departPosLatFloat = GNEAttributeCarrier::parse<double>(departPosLat);
488 if ((departPosLatFloat < 0) && (departPosLat !=
"random") && (departPosLat !=
"random_free") &&
489 (departPosLat !=
"left") && (departPosLat !=
"right") && (departPosLat !=
"center")) {
500 double arrivalPosLatFloat = -1;
501 if (GNEAttributeCarrier::canParse<double>(arrivalPosLat)) {
502 arrivalPosLatFloat = GNEAttributeCarrier::parse<double>(arrivalPosLat);
504 if ((arrivalPosLatFloat < 0) && (arrivalPosLat !=
"left") && (arrivalPosLat !=
"right") && (arrivalPosLat !=
"center") && (arrivalPosLat !=
"")) {
526 if (GNEAttributeCarrier::canParse<double>(begin)) {
527 return setBegin(GNEAttributeCarrier::parse<double>(begin));
547 if (GNEAttributeCarrier::canParse<double>(end)) {
548 return setEnd(GNEAttributeCarrier::parse<double>(end));
557 if (vehsPerHour < 0) {
568 if (GNEAttributeCarrier::canParse<double>(vehsPerHour)) {
569 return setVehsPerHour(GNEAttributeCarrier::parse<double>(vehsPerHour));
589 if (GNEAttributeCarrier::canParse<double>(period)) {
590 return setPeriod(GNEAttributeCarrier::parse<double>(period));
598 if ((probability < 0) || (probability > 1)) {
609 if (GNEAttributeCarrier::canParse<double>(probability)) {
610 return setProbability(GNEAttributeCarrier::parse<double>(probability));
630 if (GNEAttributeCarrier::canParse<int>(number)) {
631 return setNumber(GNEAttributeCarrier::parse<int>(number));
632 }
else if (GNEAttributeCarrier::canParse<double>(number)) {
633 double numberDouble = GNEAttributeCarrier::parse<double>(number);
635 if (fmod(numberDouble, 1) == 0) {
bool setLine(std::string line="")
set line of busStop/containerStop
bool setDepartSpeed(std::string departSpeed="0")
set depart speed
SumoXMLTag
Numbers representing SUMO-XML - element names.
const std::vector< GNECalibratorRoute > & getCalibratorRoutes() const
get calibrator routes
bool operator==(const GNECalibratorFlow &calibratorFlow) const
overload operator ==
SumoXMLTag getTag() const
get tag
bool flowExists(const std::string &flowID) const
Check if exist a flow with these ID.
const std::string & getArrivalLane() const
get arrival lane
bool setColor(std::string color="")
set color of flow
bool setContainerNumber(int containerNumber=0)
set number of container
const std::vector< GNECalibratorVehicleType > & getCalibratorVehicleTypes() const
get calibrator vehicleTypes
a flow definition (used by router)
int getNumber() const
get number of flows
bool setVehicleType(std::string vehicleType)
set vehicleType of flow
const std::string & getArrivalSpeed() const
get arrival speed
~GNECalibratorFlow()
destructor
std::string myLine
line of bus/container stop
const std::string & getDepartSpeed() const
get arrival speed
bool vehicleTypeExists(const std::string &vehicleTypeID) const
Check if exist a vehicle type with these ID.
std::string getArrivalPosLat() const
const std::string & getArrivalPos() const
get arrival position
std::string myDepartPosLat
departPosLat
bool routeExists(const std::string &routeID) const
Check if exist a route with these ID.
GNECalibrator * getCalibratorParent() const
get pointer to calibrator parent
bool setPeriod(double period)
set period of flows
bool setArrivalLane(std::string arrivalLane="current")
set arrival lane
bool setArrivalPos(std::string arrivalPos="max")
set arrival position
const std::string & getVehicleType() const
get vehicle type of flow
int myNumber
number of flow
std::string myArrivalPos
arrival pos
std::string getDepartPosLat() const
get departPosLat
bool setVehsPerHour(double vehsPerHour)
set flows per hour
const std::string & getRoute() const
get route in which this flow is used
double myEnd
time step end
std::string myArrivalPosLat
int myPersonNumber
number of person
bool setPersonNumber(int personNumber=0)
set number of persons
std::string myDepartPos
depart position
bool setBegin(double begin)
set begin step
TypeOfFlow getFlowType() const
get type of flow
bool setDepartPosLat(std::string departPosLat="center")
set departPosLat
GNEViewNet * getViewNet() const
Returns a pointer to GNEViewNet in which additional element is located.
std::string myRoute
route in which this flow is used
std::string myDepartLane
depart lane
bool setRoute(std::string route)
set route in which this flow is used
double getPeriod() const
get period of flow
std::string myArrivalLane
arrival lane
const std::string & getDepartPos() const
get depart position
bool setDepartPos(std::string departPos="base")
set depart position
bool setReroute(bool value)
set reroute
double myVehsPerHour
flows per hour
const std::string & getFlowID() const
get ID of flow
std::string myFlowID
ID of flow.
int myContainerNumber
number of container
bool setArrivalSpeed(std::string arrivalSpeed="current")
set arrival speed
bool setFlowID(std::string ID)
set ID of flow
const std::string & getDepartLane() const
get depart lane
GNECalibratorFlow(GNECalibrator *calibratorParent)
constructor
int getContainerNumber() const
get number of containers
double getVehsPerHour() const
get flows per hour
bool setProbability(double probability)
set probability of flow
double myProbability
probability
GNECalibrator * myCalibratorParent
pointer to calibrator parent
std::string myColor
color of flow
std::string myArrivalSpeed
arrival speed
const std::string & getColor() const
get color of flow
int getPersonNumber() const
get number of persons
bool setTypeOfFlow(TypeOfFlow type)
set type of flow
std::string myDepartSpeed
depart speed
const std::string & getLine() const
get line of busStop/containerStop
bool setDepartLane(std::string departLane="first")
set depart lane
bool setNumber(int number)
set number of flows
GNENet * getNet() const
get the net object
TypeOfFlow myTypeOfFlow
type of flow
double getProbability() const
get probability of flow
bool setArrivalPosLat(std::string arrivalPosLat="")
set arrivalPosLat
bool getReroute() const
get reroute
std::string myVehicleType
type of flow
bool setEnd(double end)
set end step
double getEnd() const
get end time step