Distributed Emergency Guiding with Evacuation Time Optimization Based on Wireless Sensor Networks