That's oddly specific. I'm not sure if you'll find ready made C++ code that will be able to do it.
You should consider implementing it instead of looking for a ready made solution. For something like this, I would almost want to set up an LP to cluster them such that the most amount of information is gathered from the sensors. I'm no expert in the field though.
Again, it's an oddly specific peice of code you need, and I don't think it's likely you'll find it ready made for you to use. That is one of the many limitations of copy-and-paste programming.
You could try to find some academic papers in the matter, and perhaps they might have some sample code. You'll need to be carefull about licensing however, and you'll likely need to ask the author for permission (which might involve royalties).
Otherwise, you'll need to implement it on your own, or hire someone to implement it for you.
To reiterate what Hiroshe mentions, there is a wealth of information available on this topic in the literature (try google scholar if you do not have access to university resources directly).
I imagine you will find some paper that references an open source (probably half-complete) version of their code written for ns-3 (a common simulation platform for wireless networks written in C++) or matlab. That would be about the best you are going to get to what you ultimately want.
You are not going to get written code that solves you problem exactly.