A Dynamic Routing Algorithm in Wireless Sensor Networks Based on Ant Colony Optimization