Major rework using rocketpy

This commit is contained in:
dario
2024-06-07 15:01:16 +02:00
parent 1b06db4152
commit 382cb9aad4
25 changed files with 13173 additions and 102 deletions

View File

@@ -4,43 +4,7 @@ import pandas as pd
from typing import Any, Tuple, List
from numpy.typing import ArrayLike
from abc import abstractmethod
class Advanceable:
def __init__(self) -> None:
self.reset()
def step(self, dt: float):
"""Advances the simulation data in time.
Args:
dt (float): The step in time to make.
"""
self.__t += dt
self._on_step(dt)
def reset(self):
"""
Reset the Avanceable object to its initial state.
"""
self.__t = 0
self._on_reset()
@abstractmethod
def _on_step(self, dt: float):
pass
@abstractmethod
def _on_reset(self):
pass
def get_time(self) -> float:
"""
Returns:
float: Returns the current time of the Advanceable.
"""
return self.__t
from spatz.simulations.advanceable import Advanceable
class Logger(Advanceable):