From 59e44c6a8ae4fc54ac9548ad9e258ab9e525179f Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Mon, 4 Mar 2024 14:22:43 -0500 Subject: [PATCH] ENH: improves initialization of time and state variables in Flight class --- CHANGELOG.md | 1 + rocketpy/simulation/flight.py | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a09c24c0a..55fa2b4fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ Attention: The newest changes should be on top --> ### Changed - +- ENH: Initial solution from flights gets previous results [#568](https://github.com/RocketPy-Team/RocketPy/pull/568) - DOC: New Environment class docs pages [#644](https://github.com/RocketPy-Team/RocketPy/pull/644) ### Fixed diff --git a/rocketpy/simulation/flight.py b/rocketpy/simulation/flight.py index 31d1f79d5..f962e1abc 100644 --- a/rocketpy/simulation/flight.py +++ b/rocketpy/simulation/flight.py @@ -1101,6 +1101,7 @@ def __init_flight_state(self): elif isinstance(self.initial_solution, Flight): # Initialize time and state variables based on last solution of # previous flight + self.solution = self.initial_solution.solution[:-1] self.initial_solution = self.initial_solution.solution[-1] # Set unused monitors self.out_of_rail_state = self.initial_solution[1:]