Learning and control for complex multiagent systems