The investigation of fire hazards in buildings using stochastic modelling