I can manage it in the model without RL agent, by writing in Callbacks >InitFcn:
set_param('modelname','StartTime','3600*24*randi(365)')
but when I apply this for RL model, it gives the error message " localHandleSimoutErrors":
Error
Caused by:
Error using rl.env.SimulinkEnvWithAgent>localHandleSimoutErrors (line 689)
Invalid StopTime specified in the Configuration Parameters dialog for block diagram 'modelname '
I specified Start and stop time as follows: