Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add median estimated lap time for episode of 10% or more progress #227

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/analyze/graph/analyze_quarterly_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def add_plots(self):
self.plot_minimum_percents(episodes, gs, 100, 2, 0)

self.plot_lap_times_stat(episodes, gs, np.median, 2, 1)
self.plot_lap_times_stat(episodes, gs, np.median, 2, 2, minimum_percent=10)

def plot_minimum_percents(self, episodes, gs, minimum_percent, graph_x, graph_y):
axes :Axes = self.graph_figure.add_subplot(gs[graph_x, graph_y])
Expand Down Expand Up @@ -156,10 +157,12 @@ def plot_episode_reward_stat(self, episodes, gs, stat_method, graph_x, graph_y):
border = 0.15 * (max_value - min_value)
axes.set_ybound(max(0.0, min_value - border), max_value + border)

def plot_lap_times_stat(self, episodes, gs, stat_method, graph_x, graph_y):
def plot_lap_times_stat(self, episodes, gs, stat_method, graph_x, graph_y, minimum_percent=None):
if minimum_percent:
episodes = [e for e in episodes if e.percent_complete >= minimum_percent]
axes :Axes = self.graph_figure.add_subplot(gs[graph_x, graph_y])

axes.set_title("Lap Time " + stat_method.__name__)
axes.set_title("Lap Time " + stat_method.__name__ + (" " + str(minimum_percent) + "%" if minimum_percent else ""))

axes.get_xaxis().set_ticklabels([])
axes.get_yaxis().set_ticklabels([])
Expand Down