Modeling Detection and Tracking of Complex Events in Wireless Sensor Networks