code: def save_simdata(self, idx: int) -> None:
          
          if self._sim_ramflag:
              self._sim_array[idx] = self.sim[0]
          elif self._sim_diskflag:
              raw = struct.pack('d', self.sim[0])
              self._sim_file.write(raw)
docs: Save the last sim sequence value (of the given index).