In classic molecular dynamics, simulations are done in the microcanonical ensemble; a number of particles, volume, and energy have a constant value.
The central idea is to simulate in such a way that we obtain a canonical distribution: this means fixing the average temperature of the system under simulation, but at the same time allowing for a fluctuation of the temperature with a distribution typical for a canonical distribution.