Scheduling And Resource Management For Complex Systems: From Large-Scale Distributed Systems To Very Large Sensor Networks