Discrete Event System Methods for Control Problems Arising in Cyber-physical Systems.