Cyber-Physical Systems for Smart City Applications: A Comparative Study