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
std::string getArrivalPosLat() const
bool operator==(const GNECalibratorFlow &calibratorFlow) const
overload operator ==
SumoXMLTag
Numbers representing SUMO-XML - element names.
double getEnd() const
get end time step
double getPeriod() const
get period of flow
bool setColor(std::string color="")
set color of flow
bool setContainerNumber(int containerNumber=0)
set number of container
bool routeExists(const std::string &routeID) const
Check if exist a route with these ID.
a flow definition (used by router)
const std::string & getArrivalSpeed() const
get arrival speed
bool setVehicleType(std::string vehicleType)
set vehicleType of flow
const std::string & getLine() const
get line of busStop/containerStop
~GNECalibratorFlow()
destructor
std::string myLine
line of bus/container stop
const std::string & getArrivalLane() const
get arrival lane
bool vehicleTypeExists(const std::string &vehicleTypeID) const
Check if exist a vehicle type with these ID.
std::string getDepartPosLat() const
get departPosLat
std::string myDepartPosLat
departPosLat
bool getReroute() const
get reroute
const std::string & getDepartSpeed() const
get arrival speed
bool setPeriod(double period)
set period of flows
const std::string & getArrivalPos() const
get arrival position
const std::vector< GNECalibratorRoute > & getCalibratorRoutes() const
get calibrator routes
bool setArrivalLane(std::string arrivalLane="current")
set arrival lane
bool setArrivalPos(std::string arrivalPos="max")
set arrival position
int myNumber
number of flow
std::string myArrivalPos
arrival pos
bool setVehsPerHour(double vehsPerHour)
set flows per hour
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
int getContainerNumber() const
get number of containers
bool setBegin(double begin)
set begin step
bool setDepartPosLat(std::string departPosLat="center")
set departPosLat
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
std::string myArrivalLane
arrival lane
bool setDepartPos(std::string departPos="base")
set depart position
int getNumber() const
get number of flows
bool setReroute(bool value)
set reroute
const std::string & getColor() const
get color of flow
double myVehsPerHour
flows per hour
std::string myFlowID
ID of flow.
int myContainerNumber
number of container
const std::string & getDepartLane() const
get depart lane
GNECalibrator * getCalibratorParent() const
get pointer to calibrator parent
bool setArrivalSpeed(std::string arrivalSpeed="current")
set arrival speed
bool setFlowID(std::string ID)
set ID of flow
GNECalibratorFlow(GNECalibrator *calibratorParent)
constructor
GNEViewNet * getViewNet() const
Returns a pointer to GNEViewNet in which additional element is located.
bool setProbability(double probability)
set probability of flow
double myProbability
probability
GNECalibrator * myCalibratorParent
pointer to calibrator parent
const std::string & getVehicleType() const
get vehicle type of flow
std::string myColor
color of flow
std::string myArrivalSpeed
arrival speed
double getVehsPerHour() const
get flows per hour
double getProbability() const
get probability of flow
int getPersonNumber() const
get number of persons
bool setTypeOfFlow(TypeOfFlow type)
set type of flow
const std::string & getDepartPos() const
get depart position
std::string myDepartSpeed
depart speed
bool setDepartLane(std::string departLane="first")
set depart lane
bool setNumber(int number)
set number of flows
const std::vector< GNECalibratorVehicleType > & getCalibratorVehicleTypes() const
get calibrator vehicleTypes
TypeOfFlow myTypeOfFlow
type of flow
GNENet * getNet() const
get the net object
SumoXMLTag getTag() const
get tag
bool flowExists(const std::string &flowID) const
Check if exist a flow with these ID.
bool setArrivalPosLat(std::string arrivalPosLat="")
set arrivalPosLat
TypeOfFlow getFlowType() const
get type of flow
const std::string & getFlowID() const
get ID of flow
std::string myVehicleType
type of flow
bool setEnd(double end)
set end step
const std::string & getRoute() const
get route in which this flow is used