Coordination of Heterogeneous Multi-Agent Systems: Programming the Interaction