SLIDE 11 Tutorial ¡TPAS ¡-‑ ¡ICRAT ¡2014 ¡ 11/06/14 ¡ 11 ¡
HOW TO USE TPAS?
- Obtain TPAS: email to sergio.ruiz@uab.es
- Installation
1. Static method è requires .dll, .lib and .h files
- Add .lib to “additional dependencies” of the linker
- Add the .h to your code
- Call the .dll from your code
2. Dinamic method è Only .dll file
- Use the method loadLibrary()
- Call the functions as given in the APIs documentation
61
The static method is easier in C++ and the dynamic is easier in Java and C#
HOW TO USE TPAS?
62
TPAS_Interface TPAS; // Create instance of TPAS int idOriginATM = TPAS.Coord_createCoord(); TPAS.Coord_setGeoandConvert(idOriginATM, 25, -25); // lat/long TPAS.Coord_setZ(idOriginATM, 2400); // in meters TPAS.Coord_setTime(idOriginATM, 0); // in seconds int idSDS = TPAS.SDS_create(); // Create the micro-scale data framework TPAS.SDS_setOriginScenarioATM(idSDS, idOriginATM); TPAS.SDS_setLengthX(idSDS, xLengthATM); TPAS.SDS_setLengthY(idSDS, yLengthATM); TPAS.SDS_setLengthZ(idSDS, zLengthATM); TPAS.SDS_setLengthT(idSDS, tLengthATM); TPAS.SDS_setSizeBins(idSDS, spatialDiscretization); TPAS.allocateMemory(idSDS); // SDS is ready
HOW TO USE TPAS?
63
// Generate waypoints int idTERTO= TPAS.Coord_createCoord_Geod(lat, long); int idRUSIK= TPAS.Coord_createCoord_Geod(lat, long); int idCANIS= TPAS.Coord_createCoord_Geod(lat, long); int idENETA= TPAS.Coord_createCoord_Geod(lat, long); int idRWY= TPAS.Coord_createCoord_Geod(lat, long, z); // Generate routes int idTERTO3C = TPAS.Route_create(); // TERTO3C TPAS.Route_addCoord(idTERTO3C, idTERTO); TPAS.Route_addCoord(idTERTO3C, idCANIS); TPAS.Route_addCoord(idTERTO3C, idENETA) TPAS.Route_addCoord(idTERTO3C, idRWY); int idRUSIK3C = TPAS.Route_create(); // RUSIK3C TPAS.Route_addCoord(idRUSIK3C, idRUSIK); TPAS.Route_addCoord(idRUSIK3C, idCANIS); TPAS.Route_addCoord(idRUSIK3C, idENETA); TPAS.Route_addCoord(idRUSIK3C, idRWY);
HOW TO USE TPAS?
64
// Create flights vector <int> vFlights; vFlights[0] = TPAS.Flight_create(); TPAS.Flight_setRoute(vFlights[0], idRUSIK3C); TPAS.Flight_setEntryTime(vFlights[0], 150); // in seconds TPAS.Flight_setEntrySpeed(vFlights[0], 230); // in mps TPAS.Flight_generatePlannedTrajectory(vFlights[0]); // 4DT is generated vFlights[1] = TPAS.Flight_create(); TPAS.Flight_setRoute(vFlights[1], idTERTO3C); TPAS.Flight_setEntryTime(vFlights[1], 50); // in seconds TPAS.Flight_setEntrySpeed(vFlights[1], 232); // in mps TPAS.Flight_generatePlannedTrajectory(vFlights[1]); // 4DT is generated TPAS.CD_detectConflicts(); //Perform CD and CR TPAS.CD_showConflicts(); // Output conflicts information
HOW TO USE TPAS?
65
// An example even easier TPAS_Interface TPAS; // Create instance of TPAS … // Configure originATM and SDS just as before Vector <int> vFlights; // Create vector to store the ids/pointers of flights vFlights = TPAS.Parsers_intputFreeFlight_UTM2Geod(“traffic.txt”, timezone=28); TPAS.CD_detectConflicts(); //Perform Conflict Detection TPAS.CD_showConflicts(); // Output conflicts information Note that by sharing scenarios we could apply different CR modules and perform benchmarking comparisons
x_ini y_ini h_ini x_end y_end h_end speed (in mps)
HOW TO USE TPAS?
66
// An example coupling an external CR TPAS_Interface TPAS; // Create instance of TPAS … // Configure originATM and SDS just as before Vector <int> vFlights; // Create vector to store the ids/pointers of flights vFlights = TPAS.Parsers_intputTrajectories(“C//inputTrajectories/TR_”); TPAS.CD_detectConflicts(); //Perform Conflict Detection TPAS.CD_outputConflicts2txt(); // Write conflicts in a .txt file …// Process the conflicts in your own CR vFlights = TPAS.Parsers_changeTrajectories(“C//newTrajectories/TR_”); TPAS.CD_detectConflicts(); // Verify the new scenario is clean of conflicts TPAS.Parsers_outputTrajectories2kml(vFlights ); // Output your trajectories to kml TPAS.Parsers_outputTrajectories2gnuPlot(vFlights ); // Output your trajectories to gnuPlot
Format: FlightNumber entryTime (in s.) Long Lat Height (in m.) speed (in mps)