1 /* -*- Mode: C++ -*- *****************************************************
3 * Written by Durk Talsma. Started May 5, 2004
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of the
8 * License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 **************************************************************************/
22 /**************************************************************************
23 * This file contains the definition of the class Shedule.
25 * A schedule is basically a number of scheduled flights, wich can be
26 * assigned to an AI aircraft.
27 **************************************************************************/
29 #ifndef _FGSCHEDULE_HXX_
30 #define _FGSCHEDULE_HXX_
32 #define TRAFFICTOAIDIST 150.0
46 FGScheduledFlightVec flights;
51 double distanceToUser;
58 FGAISchedule(); // constructor
59 FGAISchedule(string, string, string, bool, string, string, string, string, double, double,
60 int, FGScheduledFlightVec); // construct & init
61 FGAISchedule(const FGAISchedule &other); // copy constructor
63 ~FGAISchedule(); //destructor
65 bool update(time_t now);
69 //void setClosestDistanceToUser();
70 void next(); // forces the schedule to move on to the next flight.
72 time_t getDepartureTime () { return flights.begin()->getDepartureTime (); };
73 FGAirport * getDepartureAirport () { return flights.begin()->getDepartureAirport(); };
74 FGAirport * getArrivalAirport () { return flights.begin()->getArrivalAirport (); };
75 int getCruiseAlt () { return flights.begin()->getCruiseAlt (); };
76 double getRadius () { return radius; };
77 double getGroundOffset () { return groundOffset;};
78 const string& getFlightType () { return flightType;};
79 const string& getAirline () { return airline; };
80 const string& getAircraft () { return acType; };
81 const string& getCallSign () { return flights.begin()->getCallSign (); };
82 const string& getRegistration () { return registration;};
83 bool getHeavy () { return heavy; };
84 // used to sort in decending order of score: I've probably found a better way to
85 // decending order sorting, but still need to test that.
86 bool operator< (const FGAISchedule &other) const { return (score > other.score); };
87 //void * getAiRef () { return AIManagerRef; };
88 //FGAISchedule* getAddress () { return this;};
89 // More member functions follow later
93 typedef vector<FGAISchedule > ScheduleVector;
94 typedef vector<FGAISchedule >::iterator ScheduleVectorIterator;