  A desirable goal for autonomous agents is to be able to coordinate on the fly
with previously unknown teammates. Known as "ad hoc teamwork", enabling such a
capability has been receiving increasing attention in the research community.
One of the central challenges in ad hoc teamwork is quickly recognizing the
current plans of other agents and planning accordingly. In this paper, we focus
on the scenario in which teammates can communicate with one another, but only
at a cost. Thus, they must carefully balance plan recognition based on
observations vs. that based on communication. This paper proposes a new metric
for evaluating how similar are two policies that a teammate may be following -
the Expected Divergence Point (EDP). We then present a novel planning algorithm
for ad hoc teamwork, determining which query to ask and planning accordingly.
We demonstrate the effectiveness of this algorithm in a range of increasingly
general communication in ad hoc teamwork problems.
