  Given a connected region in two-dimensional space where events of a certain
kind occur according to a certain time-varying density, we consider the problem
of setting up a network of autonomous mobile agents to detect the occurrence of
those events and possibly record them in as effective a manner as possible. We
assume that agents can communicate with one another wirelessly within a fixed
communication radius, and moreover that initially no agent has any information
regarding the event density. We introduce a new distributed algorithm for agent
control based on the notion of an execution mode, which essentially lets each
agent roam the target region either at random or following its local view of a
density-dependent gradient. Agents can switch back and forth between the two
modes, and the precise manner of such changes depends on the setting of various
parameters that can be adjusted as a function of the application at hand. We
provide simulation results on some synthetic applications especially designed
to highlight the algorithm's behavior relative to the possible execution modes.
