Computer simulation of particles with position-dependent mass