def get_light_states(kernel, rl_id):
    """Map the traffic light state into an unique float number.

    Parameters:
    ----------
    kernel: obj
    Traci API obj to collect current simulation information
    (from flow.kernel in parent class)
        example- kernel.vehicle.get_accel(veh_id)
                returns the acceleration of the vehicle id


     rl_id: string
        name id of current traffic light node/intersection

    Returns:
    ---------
    light_states__ : list
         list that contains only one float number, which uniquely represents the traffic light state.
            ie. GrGrGr = [1]"""

    light_states = kernel.traffic_light.get_state(rl_id)

    if light_states == "GrGr":
        encoded_light_state = [1]
    elif light_states == "yryr":
        encoded_light_state = [0.6]
    else:
        # ryry or rGrG
        encoded_light_state = [0.2]

    return encoded_light_state