Merge pull request #437 from JoePfeiffer/fixSimulationLog
Fix simulation log
This commit is contained in:
commit
3209e0201e
@ -128,7 +128,7 @@ public class BasicEventSimulationEngine implements SimulationEngine {
|
|||||||
if (nextEvent != null) {
|
if (nextEvent != null) {
|
||||||
maxStepTime = MathUtil.max(nextEvent.getTime() - currentStatus.getSimulationTime(), 0.001);
|
maxStepTime = MathUtil.max(nextEvent.getTime() - currentStatus.getSimulationTime(), 0.001);
|
||||||
}
|
}
|
||||||
log.trace("BasicEventSimulationEngine: Taking simulation step at t=" + currentStatus.getSimulationTime());
|
log.trace("Taking simulation step at t=" + currentStatus.getSimulationTime() + " altitude " + oldAlt);
|
||||||
currentStepper.step(currentStatus, maxStepTime);
|
currentStepper.step(currentStatus, maxStepTime);
|
||||||
}
|
}
|
||||||
SimulationListenerHelper.firePostStep(currentStatus);
|
SimulationListenerHelper.firePostStep(currentStatus);
|
||||||
@ -319,6 +319,7 @@ public class BasicEventSimulationEngine implements SimulationEngine {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Handle event
|
// Handle event
|
||||||
|
log.trace("Handling event " + event);
|
||||||
switch (event.getType()) {
|
switch (event.getType()) {
|
||||||
|
|
||||||
case LAUNCH: {
|
case LAUNCH: {
|
||||||
@ -486,7 +487,7 @@ public class BasicEventSimulationEngine implements SimulationEngine {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case ALTITUDE:
|
case ALTITUDE:
|
||||||
log.trace("BasicEventSimulationEngine: Handling event " + event);
|
// nothing special needs to be done for this event
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TUMBLE:
|
case TUMBLE:
|
||||||
|
@ -182,7 +182,7 @@ public class RK4SimulationStepper extends AbstractSimulationStepper {
|
|||||||
double thrustEstimate = store.thrustForce;
|
double thrustEstimate = store.thrustForce;
|
||||||
store.thrustForce = calculateAverageThrust(status, store.timestep, store.longitudinalAcceleration,
|
store.thrustForce = calculateAverageThrust(status, store.timestep, store.longitudinalAcceleration,
|
||||||
store.atmosphericConditions, true);
|
store.atmosphericConditions, true);
|
||||||
log.trace("Thrust at time " + store.timestep + " thrustForce = " + store.thrustForce);
|
log.trace("Thrust = " + store.thrustForce);
|
||||||
double thrustDiff = Math.abs(store.thrustForce - thrustEstimate);
|
double thrustDiff = Math.abs(store.thrustForce - thrustEstimate);
|
||||||
// Log if difference over 1%, recompute if over 10%
|
// Log if difference over 1%, recompute if over 10%
|
||||||
if (thrustDiff > 0.01 * thrustEstimate) {
|
if (thrustDiff > 0.01 * thrustEstimate) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user