mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/SPATZ.git
synced 2025-12-16 17:28:04 +00:00
Major rework using rocketpy
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user