Instead of attempting to calculate interesting values for flight data every time a data branch is added and only succeeding the first time, wait until the simulation is complete and calculate them at that time.

This commit is contained in:
JoePfeiffer 2024-04-20 07:56:02 -06:00
parent 872de38b8d
commit 523fce1a4c
2 changed files with 2 additions and 4 deletions

View File

@ -145,6 +145,7 @@ public class BasicEventSimulationEngine implements SimulationEngine {
log.info("Warnings at the end of simulation: " + flightData.getWarningSet());
}
flightData.calculateInterestingValues();
return flightData;
}

View File

@ -129,9 +129,6 @@ public class FlightData {
branch.immute();
branches.add(branch);
if (branches.size() == 1) {
calculateInterestingValues();
}
}
public int getBranchCount() {
@ -201,7 +198,7 @@ public class FlightData {
* Calculate the max. altitude/velocity/acceleration, time to apogee, flight time
* and ground hit velocity.
*/
private void calculateInterestingValues() {
public void calculateInterestingValues() {
if (branches.isEmpty())
return;