Castalia Simulator for low-power wireless networks such as Wireless Sensor Networks and Body Area Networks