6a98de289a02db6bd0c715affac9242a52c633e3,flow/visualize/time_space_diagram.py,,get_time_space_data,#Any#Any#,76

Before Change


    }

    // simulation step size
    dt = params["sim"].sim_step

    // number of simulation steps
    max_time = max(max(data[veh_id]["time"]) for veh_id in data.keys())
    min_time = min(min(data[veh_id]["time"]) for veh_id in data.keys())
    num_steps = int((max_time - min_time)/dt)

    // Get the function from switcher dictionary
    func = switcher[params["scenario"]]

    // Execute the function
    return func(data, params, dt, num_steps)


def _merge(data, params, dt, num_steps):
    Generate position and speed data for the merge.

After Change


    }

    // Collect a list of all the unique times.
    all_time = []
    for veh_id in data.keys():
        all_time.extend(data[veh_id]["time"])
    all_time = np.sort(np.unique(all_time))

    // Get the function from switcher dictionary
    func = switcher[params["scenario"]]

    // Execute the function
    pos, speed = func(data, params, all_time)

    return pos, speed, all_time


def _merge(data, params, all_time):
    Generate position and speed data for the merge.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 13

Instances


Project Name: flow-project/flow
Commit Name: 6a98de289a02db6bd0c715affac9242a52c633e3
Time: 2019-06-10
Author: akreidieh@gmail.com
File Name: flow/visualize/time_space_diagram.py
Class Name:
Method Name: get_time_space_data


Project Name: biolab/orange3
Commit Name: 8d4d199c35f5163ed21ae705a16ce3c8548d60c6
Time: 2012-11-28
Author: janez.demsar@fri.uni-lj.si
File Name: Orange/data/io.py
Class Name: BasketReader
Method Name: prescan_file


Project Name: deepmipt/DeepPavlov
Commit Name: 0066f83bc6f9f3861119db2593c3007796d2056c
Time: 2018-08-30
Author: mary.vikhreva@gmail.com
File Name: deeppavlov/metrics/bleu.py
Class Name:
Method Name: per_item_bleu


Project Name: deepmipt/DeepPavlov
Commit Name: 0066f83bc6f9f3861119db2593c3007796d2056c
Time: 2018-08-30
Author: mary.vikhreva@gmail.com
File Name: deeppavlov/metrics/bleu.py
Class Name:
Method Name: bleu