2007-07-05 19:00:59 +00:00
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License as
|
|
|
|
// published by the Free Software Foundation; either version 2 of the
|
|
|
|
// License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful, but
|
|
|
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
// General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef _GN_NODE_HXX_
|
|
|
|
#define _GN_NODE_HXX_
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
2008-12-30 07:41:15 +00:00
|
|
|
|
2007-07-05 19:00:59 +00:00
|
|
|
#include <simgear/compiler.h>
|
2008-12-30 07:41:15 +00:00
|
|
|
#include <simgear/math/sg_geodesy.hxx>
|
2007-07-05 19:00:59 +00:00
|
|
|
|
|
|
|
class FGTaxiSegment;
|
2009-06-09 19:39:18 +00:00
|
|
|
typedef std::vector<FGTaxiSegment*> FGTaxiSegmentVector;
|
2007-07-05 19:00:59 +00:00
|
|
|
typedef FGTaxiSegmentVector::iterator FGTaxiSegmentVectorIterator;
|
|
|
|
|
2007-07-15 14:08:31 +00:00
|
|
|
bool sortByHeadingDiff(FGTaxiSegment *a, FGTaxiSegment *b);
|
|
|
|
bool sortByLength (FGTaxiSegment *a, FGTaxiSegment *b);
|
2007-07-05 19:00:59 +00:00
|
|
|
|
|
|
|
class FGTaxiNode
|
|
|
|
{
|
|
|
|
private:
|
2009-06-09 19:39:18 +00:00
|
|
|
SGGeod geod;
|
2007-07-05 19:00:59 +00:00
|
|
|
int index;
|
- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
|
|
|
|
bool isOnRunway;
|
|
|
|
int holdType;
|
2007-07-05 19:00:59 +00:00
|
|
|
FGTaxiSegmentVector next; // a vector of pointers to all the segments leaving from this node
|
- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
|
|
|
|
// used in way finding
|
|
|
|
double pathScore;
|
|
|
|
FGTaxiNode* previousNode;
|
|
|
|
FGTaxiSegment* previousSeg;
|
|
|
|
|
2007-07-05 19:00:59 +00:00
|
|
|
public:
|
- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
FGTaxiNode() :
|
|
|
|
index(0),
|
|
|
|
isOnRunway(false),
|
|
|
|
holdType(0),
|
|
|
|
pathScore(0),
|
|
|
|
previousNode(0),
|
|
|
|
previousSeg(0)
|
|
|
|
{
|
|
|
|
};
|
|
|
|
|
|
|
|
FGTaxiNode(const FGTaxiNode &other) :
|
2009-06-09 19:39:18 +00:00
|
|
|
geod(other.geod),
|
- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
index(other.index),
|
|
|
|
isOnRunway(other.isOnRunway),
|
|
|
|
holdType(other.holdType),
|
|
|
|
next(other.next),
|
|
|
|
pathScore(other.pathScore),
|
|
|
|
previousNode(other.previousNode),
|
|
|
|
previousSeg(other.previousSeg)
|
|
|
|
{
|
|
|
|
};
|
|
|
|
|
|
|
|
FGTaxiNode &operator =(const FGTaxiNode &other)
|
|
|
|
{
|
2009-06-09 19:39:18 +00:00
|
|
|
geod = other.geod;
|
- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
index = other.index;
|
|
|
|
isOnRunway = other.isOnRunway;
|
|
|
|
holdType = other.holdType;
|
|
|
|
next = other.next;
|
|
|
|
pathScore = other.pathScore;
|
|
|
|
previousNode = other.previousNode;
|
|
|
|
previousSeg = other.previousSeg;
|
|
|
|
return *this;
|
|
|
|
};
|
|
|
|
|
|
|
|
void setIndex(int idx) { index = idx; };
|
2009-06-09 19:39:18 +00:00
|
|
|
void setLatitude (double val);
|
|
|
|
void setLongitude(double val);
|
2011-04-17 08:19:58 +00:00
|
|
|
void setElevation(double val);
|
2009-06-09 19:39:18 +00:00
|
|
|
void setLatitude (const std::string& val);
|
|
|
|
void setLongitude(const std::string& val);
|
- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
void addSegment(FGTaxiSegment *segment) { next.push_back(segment); };
|
|
|
|
void setHoldPointType(int val) { holdType = val; };
|
|
|
|
void setOnRunway(bool val) { isOnRunway = val; };
|
|
|
|
|
|
|
|
void setPathScore (double val) { pathScore = val; };
|
|
|
|
void setPreviousNode(FGTaxiNode *val) { previousNode = val; };
|
|
|
|
void setPreviousSeg (FGTaxiSegment *val) { previousSeg = val; };
|
|
|
|
|
|
|
|
FGTaxiNode *getPreviousNode() { return previousNode; };
|
|
|
|
FGTaxiSegment *getPreviousSegment() { return previousSeg; };
|
|
|
|
|
|
|
|
double getPathScore() { return pathScore; };
|
2009-06-09 19:39:18 +00:00
|
|
|
double getLatitude() { return geod.getLatitudeDeg();};
|
|
|
|
double getLongitude(){ return geod.getLongitudeDeg();};
|
2011-04-17 08:19:58 +00:00
|
|
|
double getElevation() { return geod.getElevationM();};
|
2007-07-05 19:00:59 +00:00
|
|
|
|
2009-06-09 19:39:18 +00:00
|
|
|
const SGGeod& getGeod() const { return geod; }
|
2008-12-30 07:41:15 +00:00
|
|
|
|
2007-07-05 19:00:59 +00:00
|
|
|
int getIndex() { return index; };
|
- Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
|
|
|
int getHoldPointType() { return holdType; };
|
|
|
|
bool getIsOnRunway() { return isOnRunway; };
|
|
|
|
|
2007-07-05 19:00:59 +00:00
|
|
|
FGTaxiNode *getAddress() { return this;};
|
|
|
|
FGTaxiSegmentVectorIterator getBeginRoute() { return next.begin(); };
|
|
|
|
FGTaxiSegmentVectorIterator getEndRoute() { return next.end(); };
|
|
|
|
bool operator<(const FGTaxiNode &other) const { return index < other.index; };
|
|
|
|
|
2011-04-17 08:19:58 +00:00
|
|
|
//void sortEndSegments(bool);
|
2007-07-05 19:00:59 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2009-06-09 19:39:18 +00:00
|
|
|
typedef std::vector<FGTaxiNode*> FGTaxiNodeVector;
|
2007-07-05 19:00:59 +00:00
|
|
|
typedef FGTaxiNodeVector::iterator FGTaxiNodeVectorIterator;
|
|
|
|
|
|
|
|
#endif
|