{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "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\n",
    "from plotting import plot_trajectory, plot_trajectory_hexbin"
   ]
  },
  {
   "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": 5,
   "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": "[encoded data, 111676 characters]",
      "text/plain": [
       "<Figure size 480x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot_trajectory(trajectory, walker.context_map)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 48220 characters]",
      "text/plain": [
       "<Figure size 400x400 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "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
}
