Hi Federico, it seems like Simulink is saving simulation data to .dmr files in your temporary directory, despite using the 'rlTrainingOptions' with 'SimulationStorageType' set to "memory". Here are steps to ensure data is stored in RAM:
1. Simulink Data Inspector Settings
Ensure logging is set to "View during simulation only" and "Save data in MAT files" is unchecked:
- Open Simulink Data Inspector.
- Go to Preferences (gear icon).
- Set "Record mode" to "View during simulation only".
- Uncheck "Save data in MAT files".
2. Make sure your training options specify to use memory:
trainingOptions = rlTrainingOptions(...
'MaxStepsPerEpisode', 500, ...
'StopTrainingCriteria', 'AverageReward', ...
'StopTrainingValue', 500, ...
'ScoreAveragingWindowLength', 100, ...
'SaveAgentCriteria', 'EpisodeReward', ...
'SaveAgentValue', 500, ...
'SimulationStorageType', 'memory');
3. Model Configuration
Disable unnecessary logging in your Simulink model:
- Open Configuration Parameters (Ctrl+E).
- Under "Data Import/Export", disable unnecessary logging options.
4. Model Callbacks
Check for callbacks that may log data to disk:
- Open Model Properties.
- Check the "Callbacks" tab.
5. Programmatically Disable Logging
Use 'set_param' to disable logging:
set_param(gcs, 'DataLogging', 'off');
set_param(gcs, 'SignalLogging', 'off');
set_param(gcs, 'DSMLogging', 'off');
set_param(gcs, 'SaveFormat', 'Array');
By following these steps, you should be able to keep the simulation data in RAM.