From Bounded Rationality to Collective Behavior