Opinion dynamics with similarity