+ double landed_time(AltosRecordIterable iterable) {
+ AltosState state = null;
+ for (AltosRecord record : iterable) {
+ state = new AltosState(record, state);
+
+ if (state.state == Altos.ao_flight_landed)
+ break;
+ }
+
+ double landed_height = state.height;
+
+ state = null;
+
+ boolean above = true;
+
+ double landed_time = -1000;
+
+ for (AltosRecord record : iterable) {
+ state = new AltosState(record, state);
+
+ if (state.height > landed_height + 10) {
+ above = true;
+ } else {
+ if (above && state.height < landed_height + 2) {
+ above = false;
+ landed_time = state.time;
+ }
+ }
+ }
+ if (landed_time == -1000)
+ landed_time = state.time;
+ return landed_time;
+ }
+
+ double boost_time(AltosRecordIterable iterable) {
+ double boost_time = -1000;
+
+ AltosState state = null;
+
+ for (AltosRecord record : iterable) {
+ state = new AltosState(record, state);
+
+ if (state.acceleration < 1)
+ boost_time = state.time;
+ if (state.state >= Altos.ao_flight_boost)
+ break;
+ }
+ if (boost_time == -1000)
+ boost_time = state.time;
+ return boost_time;
+ }
+
+
+ public AltosFlightStats(AltosRecordIterable iterable) throws InterruptedException, IOException {