def reward_min_waiting_time(state, *args):
    """Minimizing the waiting time.

    Params:
    ------
    * state: ilurl.state.State
        captures the delay experienced by phases.

    Returns:
    --------
    * ret: dict<str, float>
        keys: tls_ids, values: rewards

    """
    try:
        wait_times = state.feature_map(
            filter_by=('waiting_time',)
        )
    except AttributeError:
        wait_times = state

    ret = {}
    for tls_id, phase_obs in wait_times.items():
        ret[tls_id] = -sum([dly for obs in phase_obs for dly in obs])
    return ret