Agent-based decentralised coordination for sensor networks using the max-sum algorithm