Human-in-the-Loop Cyber Physical Systems