A switched ramp-metering controller for freeway traffic systems