Move recovery device check to simulation startup. It doesn't need to be checked on every iteration.
This commit is contained in:
parent
b42acb5416
commit
9d24cecbef
@ -73,6 +73,14 @@ public class BasicEventSimulationEngine implements SimulationEngine {
|
|||||||
}
|
}
|
||||||
|
|
||||||
currentStatus = new SimulationStatus(simulationConfig, simulationConditions);
|
currentStatus = new SimulationStatus(simulationConfig, simulationConditions);
|
||||||
|
|
||||||
|
// Sanity checks on design and configuration
|
||||||
|
|
||||||
|
// No recovery device
|
||||||
|
if (!currentStatus.getConfiguration().hasRecoveryDevice()) {
|
||||||
|
currentStatus.getWarnings().add(Warning.NO_RECOVERY_DEVICE);
|
||||||
|
}
|
||||||
|
|
||||||
currentStatus.getEventQueue().add(new FlightEvent(FlightEvent.Type.LAUNCH, 0, simulationConditions.getRocket()));
|
currentStatus.getEventQueue().add(new FlightEvent(FlightEvent.Type.LAUNCH, 0, simulationConditions.getRocket()));
|
||||||
{
|
{
|
||||||
// main simulation branch
|
// main simulation branch
|
||||||
@ -342,11 +350,6 @@ public class BasicEventSimulationEngine implements SimulationEngine {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add a warning if there is no recovery device defined.
|
|
||||||
if (!currentStatus.getConfiguration().hasRecoveryDevice()) {
|
|
||||||
currentStatus.getWarnings().add(Warning.NO_RECOVERY_DEVICE);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Handle event
|
// Handle event
|
||||||
log.trace("Handling event " + event);
|
log.trace("Handling event " + event);
|
||||||
switch (event.getType()) {
|
switch (event.getType()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user