Simulation of the fluorescence detector of the Pierre Auger Observatory