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:
parent
872de38b8d
commit
523fce1a4c
@ -145,6 +145,7 @@ public class BasicEventSimulationEngine implements SimulationEngine {
|
|||||||
log.info("Warnings at the end of simulation: " + flightData.getWarningSet());
|
log.info("Warnings at the end of simulation: " + flightData.getWarningSet());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
flightData.calculateInterestingValues();
|
||||||
return flightData;
|
return flightData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,9 +129,6 @@ public class FlightData {
|
|||||||
branch.immute();
|
branch.immute();
|
||||||
branches.add(branch);
|
branches.add(branch);
|
||||||
|
|
||||||
if (branches.size() == 1) {
|
|
||||||
calculateInterestingValues();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getBranchCount() {
|
public int getBranchCount() {
|
||||||
@ -201,7 +198,7 @@ public class FlightData {
|
|||||||
* Calculate the max. altitude/velocity/acceleration, time to apogee, flight time
|
* Calculate the max. altitude/velocity/acceleration, time to apogee, flight time
|
||||||
* and ground hit velocity.
|
* and ground hit velocity.
|
||||||
*/
|
*/
|
||||||
private void calculateInterestingValues() {
|
public void calculateInterestingValues() {
|
||||||
if (branches.isEmpty())
|
if (branches.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user