Ad-Hoc Teamwork With Behavior-Switching Agents