diff --git a/src/mpc/logs/IFM.ipynb b/src/mpc/logs/IFM.ipynb index 65407e2b..aa598d21 100644 --- a/src/mpc/logs/IFM.ipynb +++ b/src/mpc/logs/IFM.ipynb @@ -24,7 +24,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 7, "metadata": {}, "outputs": [], "source": [ @@ -65,7 +65,10 @@ " new_df = df.groupby(\"racecar_name\").median()\n", " new_df['efficiency'] = (new_df['laps_completed'] / new_df['race_time']) * track_lengths[track]\n", " new_df = new_df.reset_index()\n", - " row = [track_names[track],controller_names[controller],target_controllers[opp],target_controllers[target],new_df[new_df['racecar_name'] =='racecar2']['efficiency'].values[0],new_df[new_df['racecar_name'] =='racecar']['efficiency'].values[0],new_df['race_time'][0],val]\n", + " if(controller=='mpc_hype' or controller == \"mpcc\"):\n", + " row = [track_names[track],controller_names[controller],target_controllers[opp],target_controllers[target],new_df[new_df['racecar_name'] =='racecar2']['efficiency'].values[0],new_df[new_df['racecar_name'] =='racecar']['efficiency'].values[0],new_df['race_time'][0],val]\n", + " else:\n", + " row = [track_names[track],controller_names[controller],target_controllers[opp],controller_names[controller],new_df[new_df['racecar_name'] =='racecar2']['efficiency'].values[0],new_df[new_df['racecar_name'] =='racecar']['efficiency'].values[0],new_df['race_time'][0],val]\n", " rows.append(row)\n", "\n", " if(new_df['efficiency'].max()>6):\n", @@ -86,7 +89,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 15, "metadata": {}, "outputs": [ { @@ -98,24 +101,19 @@ "{} & Approach & Opponent Controller & Local Planner & Ego Efficiency & Opponent Efficiency & Race Duration (s) & Safety \\\\\n", "Track & & & & & & & \\\\\n", "\\midrule\n", - "Barca & DE & DE & DE & 5.12 & 4.50 & 7.63 & 0.00 \\\\\n", - "Barca & DE & DE & Pure Pursuit & 5.16 & 4.47 & 7.69 & 0.00 \\\\\n", + "Barca & DE & DE & DE & 5.14 & 4.48 & 7.66 & 0.00 \\\\\n", "Barca & MPC Hype & DE & DE & 0.00 & 5.85 & 5.47 & 0.00 \\\\\n", "Barca & MPC Hype & DE & Pure Pursuit & 0.06 & 5.74 & 5.49 & 0.00 \\\\\n", "Barca & MPCC & DE & DE & 3.18 & 3.01 & 11.26 & 0.00 \\\\\n", "Barca & MPCC & DE & Pure Pursuit & 3.01 & 3.09 & 10.90 & 3.33 \\\\\n", - "Barca & Pure Pursuit & DE & DE & 5.25 & 4.63 & 7.34 & 0.00 \\\\\n", - "Barca & Pure Pursuit & DE & Pure Pursuit & 5.24 & 4.83 & 7.38 & 0.00 \\\\\n", - "Porto & DE & DE & DE & 5.27 & 4.20 & 46.58 & 26.67 \\\\\n", - "Porto & DE & DE & Pure Pursuit & 5.31 & 5.11 & 56.55 & 50.00 \\\\\n", + "Barca & Pure Pursuit & DE & Pure Pursuit & 5.25 & 4.73 & 7.36 & 0.00 \\\\\n", + "Porto & DE & DE & DE & 5.29 & 4.65 & 51.57 & 38.33 \\\\\n", "Porto & MPC Hype & DE & DE & 0.00 & 5.27 & 5.53 & 0.00 \\\\\n", "Porto & MPC Hype & DE & Pure Pursuit & 3.06 & 5.18 & 25.74 & 13.33 \\\\\n", "Porto & MPCC & DE & DE & 3.00 & 4.97 & 7.12 & 20.00 \\\\\n", "Porto & MPCC & DE & Pure Pursuit & 3.00 & 5.34 & 55.14 & 46.67 \\\\\n", - "Porto & Pure Pursuit & DE & DE & 4.70 & 5.34 & 57.49 & 100.00 \\\\\n", - "Porto & Pure Pursuit & DE & Pure Pursuit & 4.70 & 5.33 & 57.51 & 100.00 \\\\\n", - "Walker & DE & DE & DE & 4.49 & 4.97 & 7.02 & 0.00 \\\\\n", - "Walker & DE & DE & Pure Pursuit & 4.51 & 4.98 & 6.94 & 50.00 \\\\\n", + "Porto & Pure Pursuit & DE & Pure Pursuit & 4.70 & 5.33 & 57.50 & 100.00 \\\\\n", + "Walker & DE & DE & DE & 4.50 & 4.98 & 6.98 & 25.00 \\\\\n", "Walker & MPC Hype & DE & DE & 0.06 & 4.72 & 5.51 & 3.33 \\\\\n", "Walker & MPC Hype & DE & Pure Pursuit & 1.34 & 4.71 & 5.54 & 0.00 \\\\\n", "Walker & MPCC & DE & DE & 3.24 & 5.10 & 38.94 & 10.00 \\\\\n", @@ -130,6 +128,7 @@ "source": [ "rows = summarize_directory('two_vehicle_experiments')\n", "df = pd.DataFrame(rows, columns =['Track', 'Approach','Opponent Controller','Local Planner','Ego Efficiency','Opponent Efficiency','Race Duration (s)','Safety'])\n", + "df = df.groupby(['Track', 'Approach','Opponent Controller','Local Planner']).mean().reset_index()\n", "df = round(df,2)\n", "df = df.set_index('Track').sort_values(by=[\"Track\",\"Approach\"])\n", "print(df.to_latex())" @@ -156,30 +155,24 @@ "{} & Approach & Opponent Controller & Local Planner & Ego Efficiency & Opponent Efficiency & Race Duration (s) & Safety \\\\\n", "Track & & & & & & & \\\\\n", "\\midrule\n", - "Barca & DE & DE & DE & 5.06 & 4.60 & 6.09 & 0.00 \\\\\n", - "Barca & DE & DE & Pure Pursuit & 5.04 & 4.57 & 6.05 & 0.00 \\\\\n", + "Barca & DE & DE & DE & 5.05 & 4.59 & 6.07 & 0.00 \\\\\n", "Barca & MPC Hype & DE & DE & 0.69 & 5.11 & 5.37 & 0.00 \\\\\n", "Barca & MPC Hype & DE & Pure Pursuit & 0.09 & 4.64 & 5.36 & 0.00 \\\\\n", "Barca & MPCC & DE & DE & 3.30 & 2.70 & 10.60 & 0.00 \\\\\n", "Barca & MPCC & DE & Pure Pursuit & 3.37 & 3.10 & 9.97 & 0.00 \\\\\n", - "Barca & Pure Pursuit & DE & DE & 5.41 & 3.97 & 7.15 & 0.00 \\\\\n", - "Barca & Pure Pursuit & DE & Pure Pursuit & 5.40 & 3.93 & 7.14 & 0.00 \\\\\n", - "Porto & DE & DE & DE & 5.38 & 4.38 & 33.76 & 30.00 \\\\\n", - "Porto & DE & DE & Pure Pursuit & 5.39 & 3.82 & 33.81 & 26.67 \\\\\n", + "Barca & Pure Pursuit & DE & Pure Pursuit & 5.41 & 3.95 & 7.14 & 0.00 \\\\\n", + "Porto & DE & DE & DE & 5.38 & 4.10 & 33.78 & 28.33 \\\\\n", "Porto & MPC Hype & DE & DE & 1.19 & 4.50 & 5.40 & 0.00 \\\\\n", "Porto & MPC Hype & DE & Pure Pursuit & 2.75 & 2.96 & 43.26 & 30.00 \\\\\n", "Porto & MPCC & DE & DE & 1.66 & 4.23 & 5.39 & 3.33 \\\\\n", "Porto & MPCC & DE & Pure Pursuit & 1.83 & 4.00 & 5.37 & 16.67 \\\\\n", - "Porto & Pure Pursuit & DE & DE & 4.70 & 3.75 & 57.31 & 73.33 \\\\\n", - "Porto & Pure Pursuit & DE & Pure Pursuit & 4.70 & 3.71 & 57.30 & 66.67 \\\\\n", - "Walker & DE & DE & DE & 4.69 & 5.22 & 5.45 & 3.33 \\\\\n", - "Walker & DE & DE & Pure Pursuit & 4.67 & 5.24 & 5.43 & 0.00 \\\\\n", + "Porto & Pure Pursuit & DE & Pure Pursuit & 4.70 & 3.73 & 57.30 & 70.00 \\\\\n", + "Walker & DE & DE & DE & 4.68 & 5.23 & 5.44 & 1.67 \\\\\n", "Walker & MPC Hype & DE & DE & 0.99 & 5.27 & 5.36 & 0.00 \\\\\n", "Walker & MPC Hype & DE & Pure Pursuit & 2.15 & 5.27 & 5.37 & 0.00 \\\\\n", "Walker & MPCC & DE & DE & 3.29 & 3.27 & 54.99 & 50.00 \\\\\n", "Walker & MPCC & DE & Pure Pursuit & 4.64 & 3.54 & 20.78 & 13.33 \\\\\n", - "Walker & Pure Pursuit & DE & DE & 6.35 & 5.21 & 57.30 & 83.33 \\\\\n", - "Walker & Pure Pursuit & DE & Pure Pursuit & 6.35 & 5.20 & 57.31 & 93.33 \\\\\n", + "Walker & Pure Pursuit & DE & Pure Pursuit & 6.35 & 5.21 & 57.31 & 88.33 \\\\\n", "\\bottomrule\n", "\\end{tabular}\n", "\n" @@ -189,6 +182,7 @@ "source": [ "rows = summarize_directory('three_vehicle_experiments')\n", "df2 = pd.DataFrame(rows, columns =['Track', 'Approach','Opponent Controller','Local Planner','Ego Efficiency','Opponent Efficiency','Race Duration (s)','Safety'])\n", + "df2 = df2.groupby(['Track', 'Approach','Opponent Controller','Local Planner']).mean().reset_index()\n", "df2 = round(df2,2)\n", "df2 = df2.set_index('Track').sort_values(by=[\"Track\",\"Approach\"])\n", "print(df2.to_latex())" @@ -205,7 +199,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 17, "metadata": {}, "outputs": [ { @@ -217,14 +211,12 @@ "{} & Approach & Opponent Controller & Local Planner & Ego Efficiency & Opponent Efficiency & Race Duration (s) & Safety \\\\\n", "Track & & & & & & & \\\\\n", "\\midrule\n", - "Porto & DE & DE & DE & 4.88 & 3.78 & 24.64 & 16.67 \\\\\n", - "Porto & DE & DE & Pure Pursuit & 5.03 & 4.08 & 21.21 & 10.00 \\\\\n", + "Porto & DE & DE & DE & 4.96 & 3.93 & 22.93 & 13.33 \\\\\n", "Porto & MPC Hype & DE & DE & 1.08 & 4.77 & 5.39 & 0.00 \\\\\n", "Porto & MPC Hype & DE & Pure Pursuit & 2.16 & 4.42 & 9.05 & 0.00 \\\\\n", "Porto & MPCC & DE & DE & 2.78 & 5.20 & 11.32 & 0.00 \\\\\n", "Porto & MPCC & DE & Pure Pursuit & 1.32 & 4.61 & 5.40 & 0.00 \\\\\n", - "Porto & Pure Pursuit & DE & DE & 4.43 & 4.82 & 15.46 & 0.00 \\\\\n", - "Porto & Pure Pursuit & DE & Pure Pursuit & 4.47 & 4.84 & 15.37 & 3.33 \\\\\n", + "Porto & Pure Pursuit & DE & Pure Pursuit & 4.45 & 4.83 & 15.42 & 1.67 \\\\\n", "\\bottomrule\n", "\\end{tabular}\n", "\n" @@ -234,6 +226,7 @@ "source": [ "rows = summarize_directory('dynamic_obstacle_experiments',obstacle=\"true\")\n", "df3 = pd.DataFrame(rows, columns =['Track', 'Approach','Opponent Controller','Local Planner','Ego Efficiency','Opponent Efficiency','Race Duration (s)','Safety'])\n", + "df3 = df3.groupby(['Track', 'Approach','Opponent Controller','Local Planner']).mean().reset_index()\n", "df3 = round(df3,2)\n", "df3 = df3.set_index('Track').sort_values(by=[\"Track\",\"Approach\"])\n", "print(df3.to_latex())" @@ -248,7 +241,7 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": 18, "metadata": {}, "outputs": [ { @@ -260,14 +253,12 @@ "{} & Approach & Opponent Controller & Local Planner & Ego Efficiency & Opponent Efficiency & Race Duration (s) & Safety \\\\\n", "Track & & & & & & & \\\\\n", "\\midrule\n", - "Porto & DE & DE & DE & 0.41 & 1.77 & 5.51 & 0.00 \\\\\n", - "Porto & DE & DE & Pure Pursuit & 1.05 & 1.74 & 5.43 & 0.00 \\\\\n", + "Porto & DE & DE & DE & 0.73 & 1.76 & 5.47 & 0.00 \\\\\n", "Porto & MPC Hype & DE & DE & 0.92 & 2.13 & 5.57 & 0.00 \\\\\n", "Porto & MPC Hype & DE & Pure Pursuit & 2.21 & 0.55 & 12.27 & 0.00 \\\\\n", "Porto & MPCC & DE & DE & 1.24 & 1.46 & 7.66 & 6.67 \\\\\n", "Porto & MPCC & DE & Pure Pursuit & 2.77 & 1.90 & 9.91 & 0.00 \\\\\n", - "Porto & Pure Pursuit & DE & DE & 3.01 & 1.15 & 6.47 & 0.00 \\\\\n", - "Porto & Pure Pursuit & DE & Pure Pursuit & 2.98 & 1.27 & 6.49 & 3.33 \\\\\n", + "Porto & Pure Pursuit & DE & Pure Pursuit & 3.00 & 1.21 & 6.48 & 1.67 \\\\\n", "\\bottomrule\n", "\\end{tabular}\n", "\n" @@ -277,10 +268,18 @@ "source": [ "rows = summarize_directory('static_obstacle_experiments',False,obstacle=\"false\")\n", "df4 = pd.DataFrame(rows, columns =['Track', 'Approach','Opponent Controller','Local Planner','Ego Efficiency','Opponent Efficiency','Race Duration (s)','Safety'])\n", + "df4 = df4.groupby(['Track', 'Approach','Opponent Controller','Local Planner']).mean().reset_index()\n", "df4 = round(df4,2)\n", "df4 = df4.set_index('Track').sort_values(by=[\"Track\",\"Approach\"])\n", "print(df4.to_latex())" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": {