Cognitive Solutions for Resource Management in Wireless Sensor Networks