Dynamic optimization with random and smoothed constraints