Planning and learning for weakly-coupled distributed agents