Planck’s formula for classical oscillators with stochasticity thresholds