We present a technique for mapping a distributed algorithm to a set of homogeneous mobile agents that solves the distributed control problem known as election. Our solution is as efficient as the corresponding distributed algorithm, but does not rely on message passing between custom protocols located on communicating nodes. Rather, the proposed solution relies on mobile agents. We also present an environment model that supports not only the mapping to election agents but other agent-based solutions to distributed control problems based on distributed algorithms.