Evolution of distributed behavior