Skip to content
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
105 changes: 105 additions & 0 deletions boxes_model_count_results.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "2cea3bd2-73b1-4025-a37d-19c26bdd8253",
"metadata": {},
"source": [
"# Model Count: a benchmark for computational time as a function of number of models present\n",
"\n",
"This test simulates a number of boxes with and without collision enabled and compares the computational time taken by each engine.\n",
"\n",
"Both scenarios are \"complex\", and we only take note of real time passed, not the errors in velocities and positions."
]
},
{
"cell_type": "markdown",
"id": "ebf83220-1d10-4f45-894b-a8653bc013e4",
"metadata": {},
"source": [
"## Physics engine comparison"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "3c9e1446-971d-4e5b-ac5f-64ef6737f352",
"metadata": {},
"outputs": [],
"source": [
"import matplotlib as mpl\n",
"import matplotlib.pyplot as plt\n",
"%matplotlib inline\n",
"%config InlineBackend.figure_format = 'png'\n",
"mpl.rcParams.update({'font.size': 16})\n",
"import csv_dictionary\n",
"import plot_helpers as ph"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "556509e6-2464-41c3-ae3b-b85d7126bfcc",
"metadata": {},
"outputs": [],
"source": [
"boxes_model_count = csv_dictionary.makeCsvDictOfArrays('test_results/BENCHMARK_boxes_model_count.csv')\n",
"print(boxes_model_count.keys())\n",
"print(set(boxes_model_count['classname']))"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a43f380c-5d29-409b-bdc9-d497f97b3a92",
"metadata": {},
"outputs": [],
"source": [
"ph.plotEnginesModelCount({'classname': 'Boxes'}\n",
" , csvDict=boxes_model_count\n",
" , yname='timeRatio'\n",
" , title='Computational Time with Number of Boxes' \n",
" )\n",
"ph.plotEnginesModelCount({'collision': 1}\n",
" , csvDict=boxes_model_count\n",
" , yname='timeRatio'\n",
" , title='With Collision'\n",
" )\n",
"ph.plotEnginesModelCount({'collision': 0}\n",
" , csvDict=boxes_model_count\n",
" , yname='timeRatio'\n",
" , title='Without Collision'\n",
" )\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f22ef866-040a-4bbf-9e27-39680e8aea6f",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.10"
}
},
"nbformat": 4,
"nbformat_minor": 5
}