If you wish to optimize a probabilistic (uncertain) system, the objective function to be optimized cannot be a single deterministic output. Rather, it must be a statistic. That is, if X was an output of a probabilistic model (and hence was output as a probability distribution), optimizing X itself would be meaningless. Rather, you would need to optimize a particular statistic (e.g., the mean or 50th percentile) of the output X.
In order to do this within GoldSim, you must use SubModels. In particular, you must embed a SubModel within an outer model. The SubModel would be a fully dynamic Monte Carlo simulation, and the outer model would be a static optimization. The optimization variables for the outer model would be statistics that have been exposed on the output interface of the SubModel.
Learn more about: