def trip_mode_type(roundSpeed, vehicle_speed_cutoff, bicycle_speed_cutoff, walk_speed_cutoff):
    """
    Estimate trip transportation mode.

    :param roundSpeed:
        fix speed value (in km/h)
    :param vehicle_speed_cutoff:
        speed greater than this value (in Km/h) will be marked as vehicle
    :param bicycle_speed_cutoff:
        speed greater than this value (in Km/h) will be marked as bicycle
    :param walk_speed_cutoff:
        speeds greater than this value (in Km/h) will be marked as pedestrian
    :return:
        integer number classifying trip mode
    """

    # round the speed to the nearest integer
    speed_ = roundSpeed

    try:

        if speed_ < 0:
            value = -1  # unknown trip mode
        # elif speed_ >=0 and speed_ < walk_speed_cutoff:
        #    value = 0  # stationary (not in a trip)
        # elif speed_ >= walk_speed_cutoff and speed_ < bicycle_speed_cutoff:
        elif speed_ >= 0 and speed_ < bicycle_speed_cutoff:
            value = 1  # pedestrian trip
        elif speed_ >= bicycle_speed_cutoff and speed_ < vehicle_speed_cutoff:
            value = 2  # bicycle trip
        elif speed_ >= vehicle_speed_cutoff:
            value = 3  # vehicle trip
        else:
            value = 0

    except:

        value = None

    return value