Self-adaptive IoT architectures