{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "nteract": {
     "transient": {
      "deleting": false
     }
    }
   },
   "source": [
    "# 1. Take a look at this (working) code\n",
    "\n",
    "... and run it. We discussed that the `context_map` varies independently of the walker. Identify the part of the code that will be affected by this change."
   ]
  },
  {
   "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 plotting import plot_trajectory, plot_trajectory_hexbin\n",
    "from walker import Walker\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true,
    "jupyter": {
     "outputs_hidden": false,
     "source_hidden": false
    },
    "nteract": {
     "transient": {
      "deleting": false
     }
    }
   },
   "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))\n",
    "\n",
    "plot_trajectory(trajectory, walker.context_map)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "nteract": {
     "transient": {
      "deleting": false
     }
    }
   },
   "source": [
    "# 2. Modify the above code to reflect the idea of a separate context_map module\n",
    "\n",
    "1. how would the import statement change as a result of needing a separate context_map module?\n",
    "2. what input arguments do the context_map functions need to take?\n",
    "3. how does the initialization of the walker change?\n",
    "    - i.e. instead of \"map_type\"\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "nteract": {
     "transient": {
      "deleting": false
     }
    }
   },
   "source": [
    "# 3. (optional) Actually break out the context map initialization\n",
    "1. Move context map initialization to three functions in a separate `context_map.py` module which all return a `context_map` array\n",
    "2. Modify the constructor of Walker to take a `context_map` array instead of a `map_type`\n",
    "3. Modify this notebook to use the new code and see if the code you wrote works!\n",
    "4. Try to run all the types:\n",
    "    - Run one simulation with a flat context map\n",
    "    - Run one simulation with a hill context map\n",
    "    - Run one simulation with a labyrinth context map"
   ]
  },
  {
   "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.11.3"
  },
  "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
}
