A theory of distributed detection