Individual based model of bacterial growth under dynamic environmental stresses