Skip to content

Commit 7821982

Browse files
committed
Fix evaluation
1 parent 74b27b1 commit 7821982

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

pixi.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ lsy_drone_racing = { path = ".", editable = true }
8181
scripts = ["tools/setup_acados.sh"]
8282

8383
[tool.pixi.tasks]
84-
evaluate = { cmd = "python scripts/evaluation.py", description = "Evaluate the controller" }
84+
evaluate = { cmd = "python scripts/evaluate.py", description = "Evaluate the controller" }
8585

8686
### environments
8787
[tool.pixi.environments]

scripts/evaluate.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Competition auto-submission script.
1+
"""Competition evaluation script.
22
33
Note:
44
Please do not alter this script or ask the course supervisors first!
@@ -16,8 +16,8 @@
1616

1717

1818
def main():
19-
"""Run the simulation N times and save the results as 'submission.csv'."""
20-
n_runs = 1
19+
"""Run the simulation N times and save the results as 'evaluation.csv'."""
20+
n_runs = 20
2121
config_file = "level2.toml"
2222
config = load_config(Path(__file__).parents[1] / "config" / config_file)
2323
ep_times = simulate(
@@ -32,18 +32,18 @@ def main():
3232

3333
# Abort if more than half of the runs failed
3434
if (success_rate := 1 - n_failed / n_runs) < 0.5:
35-
logger.error("More than 50% of all runs failed! Aborting submission.")
35+
logger.error("More than 50% of all runs failed! Aborting evaluation.")
3636
raise RuntimeError("Too many runs failed!")
3737

3838
successful_times_avg = np.mean([x for x in ep_times if x is not None])
3939
logger.info(f"Average Time: successful_times_avg (s): {successful_times_avg}")
4040
logger.info(f"Success Rate: {success_rate * 100}%")
4141
file = Path(__file__).parents[1] / "evaluation.csv"
4242
with open(file, "w") as f:
43-
f.write(f"{np.mean(successful_times_avg)},{success_rate},")
43+
f.write(f"{successful_times_avg},{success_rate},")
4444
logger.info(f"Results saved in {file}")
4545

4646

4747
if __name__ == "__main__":
4848
logging.basicConfig(level=logging.INFO)
49-
main()
49+
main()

0 commit comments

Comments
 (0)