167 lines
158 KiB
Plaintext
167 lines
158 KiB
Plaintext
|
{
|
||
|
"cells": [
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 1,
|
||
|
"metadata": {
|
||
|
"ExecuteTime": {
|
||
|
"end_time": "2022-08-18T09:50:40.616906Z",
|
||
|
"start_time": "2022-08-18T11:50:40.181358+02:00"
|
||
|
},
|
||
|
"execution": {
|
||
|
"iopub.execute_input": "2022-08-20T06:27:54.689Z",
|
||
|
"iopub.status.busy": "2022-08-20T06:27:54.685Z",
|
||
|
"iopub.status.idle": "2022-08-20T06:27:55.297Z",
|
||
|
"shell.execute_reply": "2022-08-20T06:27:55.319Z"
|
||
|
},
|
||
|
"pycharm": {
|
||
|
"name": "#%%\n"
|
||
|
}
|
||
|
},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"%matplotlib inline\n",
|
||
|
"\n",
|
||
|
"from walker import Walker"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {
|
||
|
"pycharm": {
|
||
|
"name": "#%% md\n"
|
||
|
}
|
||
|
},
|
||
|
"source": [
|
||
|
"# Simulate a trajectory"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 3,
|
||
|
"metadata": {
|
||
|
"execution": {
|
||
|
"iopub.execute_input": "2022-08-20T06:27:55.307Z",
|
||
|
"iopub.status.busy": "2022-08-20T06:27:55.303Z",
|
||
|
"iopub.status.idle": "2022-08-20T06:27:56.162Z",
|
||
|
"shell.execute_reply": "2022-08-20T06:27:56.165Z"
|
||
|
},
|
||
|
"pycharm": {
|
||
|
"name": "#%%\n"
|
||
|
}
|
||
|
},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"# Create a Walker instance\n",
|
||
|
"walker = Walker(sigma_i=3, sigma_j=4, size=200, map_type='hills')\n",
|
||
|
"\n",
|
||
|
"# Sample a next step 1000 times\n",
|
||
|
"i, j = 100, 50\n",
|
||
|
"trajectory = []\n",
|
||
|
"for _ in range(1000):\n",
|
||
|
" i, j = walker.sample_next_step(i, j)\n",
|
||
|
" trajectory.append((i, j))"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 6,
|
||
|
"metadata": {
|
||
|
"execution": {
|
||
|
"iopub.execute_input": "2022-08-20T06:27:56.177Z",
|
||
|
"iopub.status.busy": "2022-08-20T06:27:56.172Z",
|
||
|
"iopub.status.idle": "2022-08-20T06:27:56.321Z",
|
||
|
"shell.execute_reply": "2022-08-20T06:27:56.344Z"
|
||
|
},
|
||
|
"pycharm": {
|
||
|
"name": "#%%\n"
|
||
|
}
|
||
|
},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAawAAAGkCAYAAABtmxHBAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOxddXwVx9p+Zs85EQLBIYTg7q4tlFIDqlChVC7121u3W7/1Url1pXZbqtSgSh0plEJxdw8EDwSJnd35/tgd3z05obQ0/fb5/ZI5MztrM7s77/O+77xDKKUUIUKECBEixF8c1pG+gBAhQoQIESIZhANWiBAhQoSoEAgHrBAhQoQIUSEQDlghQoQIEaJCIBywQoQIESJEhUA4YIUIESJEiAqBcMAKESJEiBAVAuGAFSJEiBAhKgTCAStEiBAhQlQIhANWiBAhQoSoEKiwA9ZLL72EJk2aIC0tDd26dcPUqVOP9CX9LXDfffeBEKL8ZWVl8e2UUtx3333Izs5Geno6BgwYgCVLlhzBK66Y+Pnnn3HqqaciOzsbhBB89tlnyvZk2rm4uBjXXnstatWqhYyMDJx22mnIzc39E++iYqGsNr/ooouMZ793795KnbDNjywq5ID14Ycf4oYbbsBdd92FefPmoV+/fhg8eDA2btx4pC/tb4F27dohLy+P/y1atIhve/zxx/HUU0/hhRdewKxZs5CVlYUTTjgB+/btO4JXXPFw4MABdOrUCS+88ILv9mTa+YYbbsD48eMxduxYTJs2Dfv378cpp5wC27b/rNuoUCirzQFg0KBByrM/YcIEZXvY5kcYtAKiZ8+e9Morr1TKWrduTW+//fYjdEV/H9x77720U6dOvtscx6FZWVn00Ucf5WVFRUW0atWqdPTo0X/SFf79AICOHz+e55Np5z179tBYLEbHjh3L62zevJlalkW//fbbP+3aKyr0NqeU0pEjR9LTTz89cJ+wzY88KhzDKikpwZw5c3DiiScq5SeeeCKmT59+hK7q74VVq1YhOzsbTZo0wbnnnou1a9cCANatW4etW7cqbZ+amopjjjkmbPvDiGTaec6cOSgtLVXqZGdno3379mFf/A5MnjwZderUQcuWLXH55Zdj+/btfFvY5kceFW7A2rlzJ2zbRt26dZXyunXrYuvWrUfoqv4+6NWrF95++2189913eO2117B161b07dsXu3bt4u0btv0fi2TaeevWrUhJSUH16tUD64QoHwYPHoz33nsPEydOxJNPPolZs2Zh4MCBKC4uBhC2+V8B0SN9AYcKQoiSp5QaZSHKj8GDB/PfHTp0QJ8+fdCsWTOMGTOGG6DDtv9zcCjtHPbFoWP48OH8d/v27dG9e3c0atQIX3/9NYYNGxa4X9jmfx4qHMOqVasWIpGIIdFs377dkEhD/H5kZGSgQ4cOWLVqFfcWDNv+j0Uy7ZyVlYWSkhLk5+cH1gnx+1CvXj00atQIq1atAhC2+V8BFW7ASklJQbdu3fDDDz8o5T/88AP69u17hK7q74vi4mIsW7YM9erVQ5MmTZCVlaW0fUlJCaZMmRK2/WFEMu3crVs3xGIxpU5eXh4WL14c9sVhwq5du7Bp0ybUq1cPQNjmfwkcUZePQ8TYsWNpLBajb7zxBl26dCm94YYbaEZGBl2/fv2RvrQKj5tvvplOnjyZrl27ls6YMYOecsoptEqVKrxtH330UVq1alU6btw4umjRIjpixAhar149WlBQcISvvGJh3759dN68eXTevHkUAH3qqafovHnz6IYNGyilybXzlVdeSX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ahQceeAB5eXlo3749JkyYgEaNGiV9DDuVgKa4Q7UtsSfOrHRGFWTcVxiCauilus7Vz9Drgeo/dEHQoSb
|
||
|
"text/plain": [
|
||
|
"<Figure size 480x480 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"walker.plot_trajectory(trajectory)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 7,
|
||
|
"metadata": {
|
||
|
"pycharm": {
|
||
|
"name": "#%%\n"
|
||
|
}
|
||
|
},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAZkAAAGBCAYAAAC0IMw4AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAACMo0lEQVR4nO29e5hUxbnv/63Vt7kPA8NlkGFQGBWVQCJiDCreAEN23GRrYthBQcWYPMlOomdvzyESQaOiZsfEnX0Sf3uTIJGoZx/jMdFEUY8gQlT0qKh4yWgEEUS5zEzPtae7V/3+WKtW11q9LtUzq3suvJ/naR26q6u+Xauq3nV533oZ55yDIAiCIIqANtgCCIIgiJELGRmCIAiiaJCRIQiCIIoGGRmCIAiiaJCRIQiCIIoGGRmCIAiiaJCRIQiCIIoGGRmCIAiiaEQHW8BIQ9d17N+/H9XV1WCMDbYcgiCIAcM5R0dHByZOnAhNK+zahIxMyOzfvx+NjY2DLYMgCCJ09u7di0mTJhX0HTIyIVNdXQ3AOBg1NTWDrIYgCGLgJJNJNDY2WutbIZCRCRlxi6ympoaMDEEQI4r+PAKgB/8EQRBE0SAjQxAEQRQNMjIEQRBE0SAjQxAEQRQNMjIEQRBE0SAjI/HSSy9h0aJFqKurQ2VlJebMmYP777+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rEgAOw5bMRxdtFuxbJwuMYP+Wl3G6MF9buPdhGoK2t3Luqydt++krS7JXlz1e4xRoO0u84vp3YpVkzW7tqeonbf+cWMhIllVUCkuE7G5MI82DAGxMuAaMzwWc9m3f3jhZuhHBWfX8g+2blHXXIci5cPvWh
|
||
|
"text/plain": [
|
||
|
"<Figure size 400x400 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"walker.plot_trajectory_hexbin(trajectory)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": []
|
||
|
}
|
||
|
],
|
||
|
"metadata": {
|
||
|
"hide_input": false,
|
||
|
"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.10.11"
|
||
|
},
|
||
|
"nteract": {
|
||
|
"version": "0.28.0"
|
||
|
},
|
||
|
"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
|
||
|
}
|
||
|
},
|
||
|
"nbformat": 4,
|
||
|
"nbformat_minor": 1
|
||
|
}
|