The Barter algorithm
- for each agent, a
- for each resource, n, that a has a need for
- for each neighbour, b, that a has
- for each resource, s, a has in surplus
- a offers b the chance to barter a's surplus of s for sufficient n from b
- b accepts if it has sufficient n in surplus, it needs some s, and the amount of s offered is sufficient to satisfy it's need.
Problems with this algorithm.
- an agent trades all it's surplus in a resource in one barter. If it has lots of the resource, it doesn't get to trade a portion with different neighbours for different needs