204 lines
61 KiB
Plaintext
204 lines
61 KiB
Plaintext
|
{
|
||
|
"cells": [
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"source": [
|
||
|
"%matplotlib inline\n",
|
||
|
"\n",
|
||
|
"import matplotlib.pyplot as plt\n",
|
||
|
"import numpy as np\n",
|
||
|
"\n",
|
||
|
"from plotting import plot_trajectory\n",
|
||
|
"from walker import Walker"
|
||
|
],
|
||
|
"outputs": [],
|
||
|
"execution_count": 4,
|
||
|
"metadata": {
|
||
|
"ExecuteTime": {
|
||
|
"end_time": "2022-08-18T09:50:40.616906Z",
|
||
|
"start_time": "2022-08-18T11:50:40.181358+02:00"
|
||
|
},
|
||
|
"collapsed": false,
|
||
|
"pycharm": {
|
||
|
"name": "#%%\n"
|
||
|
},
|
||
|
"execution": {
|
||
|
"iopub.status.busy": "2023-06-28T17:23:15.993Z",
|
||
|
"iopub.execute_input": "2023-06-28T17:23:16.002Z",
|
||
|
"shell.execute_reply": "2023-06-28T17:23:16.081Z",
|
||
|
"iopub.status.idle": "2023-06-28T17:23:16.018Z"
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"source": [
|
||
|
"For this Exercise let's go back to the version of the walker with only one \"next step proposal\". "
|
||
|
],
|
||
|
"metadata": {
|
||
|
"nteract": {
|
||
|
"transient": {
|
||
|
"deleting": false
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"source": [
|
||
|
"# 1. Complete the run.py script\n",
|
||
|
"- In the file, at the top we give the desired parameters for the run\n",
|
||
|
"- create a context map and walker (see previous exercises for reference)\n",
|
||
|
"- simulate a trajectory (see previous exercises for reference)\n",
|
||
|
"- save the trajectory using `np.save()` and some metadata"
|
||
|
],
|
||
|
"metadata": {
|
||
|
"nteract": {
|
||
|
"transient": {
|
||
|
"deleting": false
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"source": [
|
||
|
"# 2. Run the run.py script twice and compare that the outcome is identical by plotting the result below"
|
||
|
],
|
||
|
"metadata": {
|
||
|
"nteract": {
|
||
|
"transient": {
|
||
|
"deleting": false
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"source": [
|
||
|
"trajectory = np.load(\"sim_20230628-192022.npy\") # change the name of the file here!"
|
||
|
],
|
||
|
"outputs": [],
|
||
|
"execution_count": 5,
|
||
|
"metadata": {
|
||
|
"collapsed": true,
|
||
|
"jupyter": {
|
||
|
"source_hidden": false,
|
||
|
"outputs_hidden": false
|
||
|
},
|
||
|
"nteract": {
|
||
|
"transient": {
|
||
|
"deleting": false
|
||
|
}
|
||
|
},
|
||
|
"execution": {
|
||
|
"iopub.status.busy": "2023-06-28T17:23:19.216Z",
|
||
|
"iopub.execute_input": "2023-06-28T17:23:19.227Z",
|
||
|
"iopub.status.idle": "2023-06-28T17:23:19.236Z",
|
||
|
"shell.execute_reply": "2023-06-28T17:23:19.239Z"
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"source": [
|
||
|
"plt.plot(trajectory[:,0], trajectory[:,1])"
|
||
|
],
|
||
|
"outputs": [
|
||
|
{
|
||
|
"output_type": "execute_result",
|
||
|
"execution_count": 6,
|
||
|
"data": {
|
||
|
"text/plain": "[<matplotlib.lines.Line2D at 0x12c7436d0>]"
|
||
|
},
|
||
|
"metadata": {}
|
||
|
},
|
||
|
{
|
||
|
"output_type": "display_data",
|
||
|
"data": {
|
||
|
"text/plain": "<Figure size 432x288 with 1 Axes>",
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD4CAYAAAAXUaZHAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAA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D5/AHUNClZf6KQVdF5vLcxifc3JeHnaEGomzUetqZklNWTXFRLRb0CgLpmFc1tXCM5FQ16WQw7TpYwtZMA2PhgJwxkApsTijpcirflvl+j2ZtahqFMQCPCOxuScLCQY28ux8HSGHtzYxwt5dibG2NtaoSsixL1RoWasrpmyuqaKa9TaB/rFS3bFJS37GtUqvn+9kEEu1qdwV/26ubnfZnE5Vfz6bz+um2iKLKy5fPS+rl4amIAj7QEQs+VhUuOsLtFTOyHOwYxIdipyxjQtYRk3C8zEgpqsDeXY2ZsQG5FI9tOFuNoacyYAEcsjA1RqkVG9nbg5/2ZF2wMi3els+5EIc9NDSIuv5rdyaU8/Mcx3X4XaxOsTY2oblSSVlJHWpsbjZOlMVNCXCioamRn8ikFv1uHeCIIcDynSrfNoYuls42ZnH7u1mxOKOpWVmBGv17Ymcspq2smr7KBmNwqKuqb6SgbzlAmYGcux97CGAcLOcaGBpTXaw15eV0z9YqOVxMWxobaG4aFMQ4WxhxILyetpE4y7m2Izqlk/YlCbh7syWAfO5KLanlpdRxHsip1GV5TQ1x4uJuK49O54+fDemqQhjIBX0dz3p4Vyv40rTvmxoFuTOwjzdbbIhn3y5DKBgXl9dpKvD0ppVQ2KHG3NeOTrSk4WhoT4WMHgHgBUnm3JRbz0ZZkZ
|
||
|
},
|
||
|
"metadata": {
|
||
|
"needs_background": "light"
|
||
|
}
|
||
|
}
|
||
|
],
|
||
|
"execution_count": 6,
|
||
|
"metadata": {
|
||
|
"collapsed": true,
|
||
|
"jupyter": {
|
||
|
"source_hidden": false,
|
||
|
"outputs_hidden": false
|
||
|
},
|
||
|
"nteract": {
|
||
|
"transient": {
|
||
|
"deleting": false
|
||
|
}
|
||
|
},
|
||
|
"execution": {
|
||
|
"iopub.status.busy": "2023-06-28T17:23:21.468Z",
|
||
|
"iopub.execute_input": "2023-06-28T17:23:21.471Z",
|
||
|
"iopub.status.idle": "2023-06-28T17:23:21.552Z",
|
||
|
"shell.execute_reply": "2023-06-28T17:23:21.558Z"
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"source": [],
|
||
|
"outputs": [],
|
||
|
"execution_count": null,
|
||
|
"metadata": {
|
||
|
"collapsed": true,
|
||
|
"jupyter": {
|
||
|
"source_hidden": false,
|
||
|
"outputs_hidden": false
|
||
|
},
|
||
|
"nteract": {
|
||
|
"transient": {
|
||
|
"deleting": false
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
],
|
||
|
"metadata": {
|
||
|
"hide_input": false,
|
||
|
"kernelspec": {
|
||
|
"display_name": "Python [default]",
|
||
|
"language": "python",
|
||
|
"name": "python3"
|
||
|
},
|
||
|
"language_info": {
|
||
|
"name": "python",
|
||
|
"version": "3.10.3",
|
||
|
"mimetype": "text/x-python",
|
||
|
"codemirror_mode": {
|
||
|
"name": "ipython",
|
||
|
"version": 3
|
||
|
},
|
||
|
"pygments_lexer": "ipython3",
|
||
|
"nbconvert_exporter": "python",
|
||
|
"file_extension": ".py"
|
||
|
},
|
||
|
"toc": {
|
||
|
"nav_menu": {
|
||
|
"height": "12px",
|
||
|
"width": "252px"
|
||
|
},
|
||
|
"navigate_menu": true,
|
||
|
"number_sections": true,
|
||
|
"sideBar": true,
|
||
|
"threshold": 4,
|
||
|
"toc_cell": false,
|
||
|
"toc_section_display": "block",
|
||
|
"toc_window_display": false
|
||
|
},
|
||
|
"nteract": {
|
||
|
"version": "0.28.0"
|
||
|
}
|
||
|
},
|
||
|
"nbformat": 4,
|
||
|
"nbformat_minor": 0
|
||
|
}
|