Dynamic weighting in Monte Carlo and optimization | Synapse