suboptimumg.compsim.custom_run#

class suboptimumg.compsim.custom_run.CustomRun(mycar, track)[source]#

Bases: object

Parameters:
plot_real_lap_comparison(real_lap_data, real_data_key, qss_var, *, layout_config=LayoutConfig(width=1000, height=700, grid_width_per_col=400, grid_height_per_row=350, grid_horizontal_spacing=0.08, grid_vertical_spacing=0.12, margin={'l': 70, 'r': 50, 't': 90, 'b': 70}, plot_bgcolor='white', scene_bgcolor='rgba(240, 240, 240, 0.8)', title_x=0.5, title_xanchor='center', title_yanchor='top'), font_config=FontConfig(large=24, medium=16, small=12), colorbar_config=ColorbarConfig(thickness=15, length=0.7))[source]#

Prints a comparison of the simulated lap with a real lap(s) from PERDA.

Parameters:
  • real_lap_data (SingleRunData) – SingleRunData representing a single real lap to compare against.

  • real_data_key (str) – The key for the real lap data to use for comparison.

  • qss_var (OverlayOptions) – The QSS variable to overlay on the plot.

  • layout_config (LayoutConfig, optional)

  • font_config (FontConfig, optional)

  • colorbar_config (ColorbarConfig, optional)

Return type:

Figure

plot_real_lap_time_delta_traces(real_laps, real_data_key, qss_var, layout_config=LayoutConfig(width=1000, height=700, grid_width_per_col=400, grid_height_per_row=350, grid_horizontal_spacing=0.08, grid_vertical_spacing=0.12, margin={'l': 70, 'r': 50, 't': 90, 'b': 70}, plot_bgcolor='white', scene_bgcolor='rgba(240, 240, 240, 0.8)', title_x=0.5, title_xanchor='center', title_yanchor='top'), font_config=FontConfig(large=24, medium=16, small=12))[source]#

Plots comparisons of the simulated lap with multiple real laps from PERDA.

Parameters:
  • real_laps (list[SingleRunData]) – List of SingleRunData representing real laps to compare against.

  • real_data_key (str) – The key for the real lap data to use for comparison.

  • qss_var (OverlayOptions) – The QSS variable to overlay on the plot.

  • layout_config (LayoutConfig, optional)

  • font_config (FontConfig, optional)

  • colorbar_config (ColorbarConfig, optional)

Return type:

Figure

print_results_summary()[source]#

Print a summary of the custom run results.

Return type:

None

run(extract_internal_data=False, initial_velocity=-1)[source]#

Simulates a run along the custom track. Sets the sim_results attribute for future use.

Parameters:
  • extract_internal_data (bool, optional) – Whether to extract internal data during the simulation, by default False.

  • initial_velocity (float, optional) – Starting velocity seed (m/s). -1 (default) lets the solver pick seeds purely from the v_max profile.

Returns:

Results from running the custom track.

Return type:

LapsimResults

class suboptimumg.compsim.custom_run.OverlayOptions(*values)[source]#

Bases: str, Enum

ACCELERATION = 'lap_accs'#
MOTOR_TORQUE = 'lap_eff_motor_torques'#
POWER = 'lap_powers'#
VELOCITY = 'lap_vels'#