  A consensus system is a linear multi-agent system in which agents communicate
to reach a so-called consensus state, defined as the average of the initial
states of the agents. Consider a more generalized situation in which each agent
is given a positive weight and the consensus state is defined as the weighted
average of the initial conditions. We characterize in this paper the weighted
averages that can be evaluated in a decentralized way by agents communicating
over a directed graph. Specifically, we introduce a linear function, called the
objective map, that defines the desired final state as a function of the
initial states of the agents. We then provide a complete answer to the question
of whether there is a decentralized consensus dynamics over a given digraph
which converges to the final state specified by an objective map. In
particular, we characterize not only the set of objective maps that are
feasible for a given digraph, but also the consensus dynamics that implements
the objective map. In addition, we present a decentralized algorithm to design
the consensus dynamics.
