Self-Adapting Software for Cyberphysical Systems