def create_clutch_list(gear_list, clutch_duration):
    """

    Returns a list with the vehicle clutch position (1 or 0) for each simulation step

    :param gear_list: A list with the vehicle gear on each simulation step
    :param clutch_duration: The duration of the clutch, in sim steps
    :return:
    """
    l1 = len(gear_list) + clutch_duration
    clutch_list = [0] * l1
    for i, gear in enumerate(gear_list[1:]):
        if gear != gear_list[i]:
            clutch_list[i + 1:i + clutch_duration] = [1] * clutch_duration
    if clutch_duration != 0:
        clutch_list = clutch_list[:-clutch_duration]
    return clutch_list
