Skip to content

Commit

Permalink
Issue #85: Set initial storage level
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzzoQM committed Nov 28, 2023
1 parent 43417d3 commit ff2f976
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bsk_rl/envs/general_satellite_tasking/simulation/dynamics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -856,13 +859,15 @@ 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
self.storageUnit.storageCapacity = dataStorageCapacity # bits
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(
Expand Down

0 comments on commit ff2f976

Please sign in to comment.