From b89d4d324f3315fe82c16c352a079956f13f7eb2 Mon Sep 17 00:00:00 2001 From: Tobias Pfandzelter Date: Wed, 24 Apr 2024 10:28:28 +0200 Subject: [PATCH] forgot satgen.py --- celestial/satgen_connstellation.py | 6 ++---- satgen.py | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/celestial/satgen_connstellation.py b/celestial/satgen_connstellation.py index a5b048e..1df2b80 100644 --- a/celestial/satgen_connstellation.py +++ b/celestial/satgen_connstellation.py @@ -47,14 +47,12 @@ def __init__( :param config: The configuration of the constellation. :param writer: The serializer to use for writing updates. """ - self.current_time = 0 + self.current_time: celestial.types.timestamp_s = config.offset self.shells: typing.List[celestial.shell.Shell] = [] self.ground_stations: typing.List[celestial.types.MachineID_dtype] = [] self.writer = writer - self.start_time: celestial.types.timestamp_s = 0 - for i, sc in enumerate(config.shells): s = celestial.shell.Shell( shell_identifier=i + 1, @@ -121,7 +119,7 @@ def __init__( self.machines_state[gst] = celestial.types.VMState.ACTIVE self.writer.diff_machine( - 0, # starting time stamp 0 + self.current_time, gst, celestial.types.VMState.ACTIVE, ) diff --git a/satgen.py b/satgen.py index 0990c11..1898303 100644 --- a/satgen.py +++ b/satgen.py @@ -82,9 +82,9 @@ ) # run the simulation - i = 0 + i = 0 + config.offset pbar = tqdm.tqdm(total=int(config.duration / config.resolution)) - while i < config.duration: + while i < config.duration + config.offset: # import cProfile # cProfile.run("constellation.step(i)", sort="cumtime")