Beispiel #1
0
def compute_window(user_selected_timestamp, study_agent, scenario):
    if user_selected_timestamp is not None:
        n_clicks_left = 0
        n_clicks_right = 0
        new_episode = make_episode(study_agent, scenario)
        center_indx = center_index(user_selected_timestamp, new_episode)

        return common_graph.compute_windows_range(new_episode, center_indx,
                                                  n_clicks_left,
                                                  n_clicks_right)
Beispiel #2
0
def compute_window(n_clicks_left, n_clicks_right, user_selected_timestamp,
                   study_agent, scenario):
    if user_selected_timestamp is None:
        raise PreventUpdate
    if n_clicks_left is None:
        n_clicks_left = 0
    if n_clicks_right is None:
        n_clicks_right = 0
    new_episode = make_episode(study_agent, scenario)
    center_indx = new_episode.timestamps.index(
        dt.datetime.strptime(user_selected_timestamp, '%Y-%m-%d %H:%M'))
    return common_graph.compute_windows_range(new_episode, center_indx,
                                              n_clicks_left, n_clicks_right)