David Culp:
Here's the newest AI stuff. The AIManager at init() creates a new scenario. Right now the default_scenario is hard coded in, but eventually the AIManager should get the scenario filename from preferences.xml. The scenario defines which AI objects will be created. Right now it only creates AIAircraft, but this is easily extended. The scenario also defines which flightplan will be assigned to the airplane. Scenario config files go in data/Data/AI. The Airplane gets a pointer to a FlightPlan object. Each airplane should get its own flightplan object, even if two airplanes have the same flight plan. This is because the flightplan maintains the iterator pointing to the current waypoint, and two airplanes might be at different locations (for instance if they were created at different times). The flight plan files go in data/Data/AI/FlightPlans. When the airplane gets to the waypoint named "END" it vanishes. The AIAircraft destructor deletes its flight plan (if it has one). The last waypoint is a place holder only. I called mine <WPT><NAME>"EOF"</NAME></WPT>.
This commit is contained in:
parent
fcab4c6e7b
commit
ef5748a00e
4 changed files with 215 additions and 0 deletions
87
Data/AI/FlightPlans/KSFO_bigsur28L.xml
Normal file
87
Data/AI/FlightPlans/KSFO_bigsur28L.xml
Normal file
|
@ -0,0 +1,87 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<!-- BIG SUR ARRIVAL, BSR.BSR2 to KSFO, Runway 28L
|
||||
The arrival can be found at http://www.airnav.com/airport/KSFO
|
||||
Format:
|
||||
<NAME> Waypoint name.
|
||||
<LAT> Latitude, degrees
|
||||
<LON> Longitude, degrees
|
||||
<ALT> Altitude, feet
|
||||
<CROSSAT> Crossing altitude, feet
|
||||
<KTAS> Knots true airspeed
|
||||
-->
|
||||
|
||||
<PropertyList>
|
||||
|
||||
<FLIGHTPLAN>
|
||||
|
||||
<WPT>
|
||||
<NAME>BSR</NAME>
|
||||
<LAT>36.181333</LAT>
|
||||
<LON>-121.642166</LON>
|
||||
<ALT>26000.0</ALT>
|
||||
<KTAS>380</KTAS>
|
||||
</WPT>
|
||||
|
||||
<WPT>
|
||||
<NAME>CARME</NAME>
|
||||
<LAT>36.455167</LAT>
|
||||
<LON>-121.879666</LON>
|
||||
<CROSSAT>20000.0</CROSSAT>
|
||||
<KTAS>350</KTAS>
|
||||
</WPT>
|
||||
|
||||
<WPT>
|
||||
<NAME>BOLDR</NAME>
|
||||
<LAT>37.17087</LAT>
|
||||
<LON>-122.0761666</LON>
|
||||
<CROSSAT>10000.0</CROSSAT>
|
||||
<KTAS>275</KTAS>
|
||||
</WPT>
|
||||
|
||||
<WPT>
|
||||
<NAME>MENLO</NAME>
|
||||
<LAT>37.463666</LAT>
|
||||
<LON>-122.1536666</LON>
|
||||
<CROSSAT>10000.0</CROSSAT>
|
||||
<KTAS>250</KTAS>
|
||||
</WPT>
|
||||
|
||||
<WPT>
|
||||
<NAME>HEMAN</NAME>
|
||||
<LAT>37.53337</LAT>
|
||||
<LON>-122.17219</LON>
|
||||
<CROSSAT>3200.0</CROSSAT>
|
||||
<KTAS>200</KTAS>
|
||||
</WPT>
|
||||
|
||||
<WPT>
|
||||
<NAME>OKDUE</NAME>
|
||||
<LAT>37.56996</LAT>
|
||||
<LON>-122.259008</LON>
|
||||
<CROSSAT>1800.0</CROSSAT>
|
||||
<KTAS>150</KTAS>
|
||||
</WPT>
|
||||
|
||||
<WPT>
|
||||
<NAME>28L</NAME>
|
||||
<LAT>37.611707</LAT>
|
||||
<LON>-122.35834</LON>
|
||||
<CROSSAT>13.0</CROSSAT>
|
||||
<KTAS>20</KTAS>
|
||||
</WPT>
|
||||
|
||||
<WPT>
|
||||
<NAME>END</NAME>
|
||||
<LAT>37.625288</LAT>
|
||||
<LON>-122.390717</LON>
|
||||
<CROSSAT>6.0</CROSSAT>
|
||||
</WPT>
|
||||
|
||||
<WPT>
|
||||
<NAME>EOF</NAME>
|
||||
</WPT>
|
||||
|
||||
</FLIGHTPLAN>
|
||||
|
||||
</PropertyList>
|
87
Data/AI/FlightPlans/KSFO_modesto28R.xml
Normal file
87
Data/AI/FlightPlans/KSFO_modesto28R.xml
Normal file
|
@ -0,0 +1,87 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<!-- MODESTO ARRIVAL, to KSFO, Runway 28R
|
||||
The arrival can be found at http://www.airnav.com/airport/KSFO
|
||||
Format:
|
||||
<NAME> Waypoint name.
|
||||
<LAT> Latitude, degrees
|
||||
<LON> Longitude, degrees
|
||||
<ALT> Altitude, feet
|
||||
<CROSSAT> Crossing altitude, feet
|
||||
<KTAS> Knots true airspeed
|
||||
-->
|
||||
|
||||
<PropertyList>
|
||||
|
||||
<FLIGHTPLAN>
|
||||
|
||||
<WPT>
|
||||
<NAME>MOD</NAME>
|
||||
<LAT>37.627333</LAT>
|
||||
<LON>-120.957833</LON>
|
||||
<ALT>20000.0</ALT>
|
||||
<KTAS>350</KTAS>
|
||||
</WPT>
|
||||
|
||||
<WPT>
|
||||
<NAME>GROAN</NAME>
|
||||
<LAT>37.590333</LAT>
|
||||
<LON>-121.285167</LON>
|
||||
<CROSSAT>15000.0</CROSSAT>
|
||||
<KTAS>310</KTAS>
|
||||
</WPT>
|
||||
|
||||
<WPT>
|
||||
<NAME>CEDES</NAME>
|
||||
<LAT>37.550833</LAT>
|
||||
<LON>-121.624667</LON>
|
||||
<CROSSAT>11000.0</CROSSAT>
|
||||
<KTAS>260</KTAS>
|
||||
</WPT>
|
||||
|
||||
<WPT>
|
||||
<NAME>FAITH</NAME>
|
||||
<LAT>37.401167</LAT>
|
||||
<LON>-121.861833</LON>
|
||||
<CROSSAT>5500.0</CROSSAT>
|
||||
<KTAS>190</KTAS>
|
||||
</WPT>
|
||||
|
||||
<WPT>
|
||||
<NAME>DUMBA</NAME>
|
||||
<LAT>37.503517</LAT>
|
||||
<LON>-122.096147</LON>
|
||||
<CROSSAT>4100.0</CROSSAT>
|
||||
<KTAS>170</KTAS>
|
||||
</WPT>
|
||||
|
||||
<WPT>
|
||||
<NAME>AXMUL</NAME>
|
||||
<LAT>37.571725</LAT>
|
||||
<LON>-122.257717</LON>
|
||||
<CROSSAT>1800.0</CROSSAT>
|
||||
<KTAS>140</KTAS>
|
||||
</WPT>
|
||||
|
||||
<WPT>
|
||||
<NAME>28R</NAME>
|
||||
<LAT>37.61353</LAT>
|
||||
<LON>-122.357138</LON>
|
||||
<CROSSAT>13.0</CROSSAT>
|
||||
<KTAS>20</KTAS>
|
||||
</WPT>
|
||||
|
||||
<WPT>
|
||||
<NAME>END</NAME>
|
||||
<LAT>37.628735</LAT>
|
||||
<LON>-122.393389</LON>
|
||||
<CROSSAT>6.0</CROSSAT>
|
||||
</WPT>
|
||||
|
||||
<WPT>
|
||||
<NAME>EOF</NAME>
|
||||
</WPT>
|
||||
|
||||
</FLIGHTPLAN>
|
||||
|
||||
</PropertyList>
|
25
Data/AI/FlightPlans/test.xml
Normal file
25
Data/AI/FlightPlans/test.xml
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<PropertyList>
|
||||
|
||||
<FLIGHTPLAN>
|
||||
|
||||
<WPT>
|
||||
<NAME>28L</NAME>
|
||||
<LAT>37.613</LAT>
|
||||
<LON>-122.361333</LON>
|
||||
<ALT>500.0</ALT>
|
||||
<KTAS>100</KTAS>
|
||||
</WPT>
|
||||
|
||||
<WPT>
|
||||
<NAME>END</NAME>
|
||||
<LAT>37.622</LAT>
|
||||
<LON>-122.38333</LON>
|
||||
<ALT>500.0</ALT>
|
||||
<KTAS>100</KTAS>
|
||||
</WPT>
|
||||
|
||||
</FLIGHTPLAN>
|
||||
|
||||
</PropertyList>
|
16
Data/AI/default_scenario.xml
Normal file
16
Data/AI/default_scenario.xml
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<PropertyList>
|
||||
|
||||
<SCENARIO>
|
||||
|
||||
<ENTRY>
|
||||
<CALLSIGN>United 720</CALLSIGN>
|
||||
<CLASS>JET_TRANSPORT</CLASS>
|
||||
<MODEL>Aircraft/737/Models/boeing733.xml</MODEL>
|
||||
<FLIGHTPLAN>KSFO_bigsur28L.xml</FLIGHTPLAN>
|
||||
</ENTRY>
|
||||
|
||||
</SCENARIO>
|
||||
|
||||
</PropertyList>
|
Loading…
Add table
Reference in a new issue