Open Ad Hoc Teamwork using Graph-based Policy Learning