Accidents, injuries and illnesses cause the demand for medical relief in cities, and the effective and planned preparation in this regard can reduce the number of injuries and casualties. The response time to medical relief is one of the criteria for evaluating medical emergency systems, which is itself a function of the presence of ambulance at the time of the request for relief and waiting time for the ambulance to arrive at the scene. The model presented in this thesis addresses the location of medical relief bases and the allocation of ambulances to them. The assumption underlying the development of this model is that the number of relief requests from each different parts of the city at different times of the day is a random variable. It is also assumed that the arrival time of the ambulance to the relief request area is influenced by traffic flow variations in the urban traort network even at a specific time of various days. Since the proposed model is nonlinear and integer, a iterative heuristic technique was used to solve it. Also, a heuristic algorithm was developed for ambulance routing to reach the relief request areas.