An integrated simulation environment for Wireless Sensor Networks