Hierarchical cooperative learning for multi-agent heterogeneous systems