Biologically-Inspired Control for Multi-Agent Self-Adaptive Tasks