From ff2f976516467fa768ac62b1e77de71ac67bfaf9 Mon Sep 17 00:00:00 2001 From: LorenzzoQM Date: Fri, 13 Oct 2023 12:07:18 -0600 Subject: [PATCH] Issue #85: Set initial storage level --- .../envs/general_satellite_tasking/simulation/dynamics.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bsk_rl/envs/general_satellite_tasking/simulation/dynamics.py b/bsk_rl/envs/general_satellite_tasking/simulation/dynamics.py index 57f6e49e..26fe356d 100644 --- a/bsk_rl/envs/general_satellite_tasking/simulation/dynamics.py +++ b/bsk_rl/envs/general_satellite_tasking/simulation/dynamics.py @@ -841,12 +841,15 @@ def _set_instrument( self.task_name, self.instrument, ModelPriority=priority ) - @default_args(dataStorageCapacity=20 * 8e6, storageUnitValidCheck=True) + @default_args( + dataStorageCapacity=20 * 8e6, storageUnitValidCheck=True, storageInit=0 + ) def _set_storage_unit( self, dataStorageCapacity: int, priority: int = 699, storageUnitValidCheck: bool = True, + storageInit: int = 0, **kwargs, ) -> None: """Configure the storage unit and its buffers. @@ -856,6 +859,7 @@ def _set_storage_unit( priority: Model priority. storageUnitValidCheck: If True, check that the storage level is below the storage capacity. + setStorageInit: Initial storage level [bits] """ self.storageUnit = simpleStorageUnit.SimpleStorageUnit() self.storageUnit.ModelTag = "storageUnit" + self.satellite.id @@ -863,6 +867,7 @@ def _set_storage_unit( self.storageUnit.addDataNodeToModel(self.instrument.nodeDataOutMsg) self.storageUnit.addDataNodeToModel(self.transmitter.nodeDataOutMsg) self.storageUnitValidCheck = storageUnitValidCheck + self.storageUnit.setDataBuffer(storageInit) # Add the storage unit to the transmitter self.transmitter.addStorageUnitToTransmitter(