Open Ad Hoc Teamwork with Cooperative Game Theory