2024-12-12 01:59:37 +00:00
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Version 1 Simulation\n",
"\n",
"The first version of this series is a basic control model. Given an elevation profile $H(x)$ and a time target, minimize energy usage.\n",
"We assume the time target is constant, since we are racing at a given overall pace. In other words, we already know the average speed $E(V) = dist/time$"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import jax.numpy as jnp\n",
"from jax import jit, vmap, lax\n",
"from jax import random\n",
"import matplotlib.pyplot as plt\n",
"\n",
"@jit\n",
"def _cov_math(t, s, H):\n",
" return 0.5 * (jnp.abs(t) ** 2 * H + jnp.abs(s) ** 2 * H - jnp.abs(t - s) ** 2 * H)\n",
"\n",
"\n",
"def _fbm_covariance(n, H) -> jnp.ndarray:\n",
" tidx = jnp.arange(1, n + 1)\n",
" t, s = jnp.meshgrid(tidx, tidx)\n",
"\n",
" # fBm covariance equation from wikipedia\n",
" cov = 0.5 * (jnp.abs(t) ** 2 * H + jnp.abs(s) ** 2 * H - jnp.abs(t - s) ** 2 * H)\n",
" return cov\n",
"\n",
"# generate terrain using fractional brownian motion\n",
"def gen_elevation_profile(rngkey: random.PRNGKey, n_steps: int, H: float):\n",
" t = jnp.linspace(0,1,n_steps)\n",
" cov = _fbm_covariance(n_steps, H)\n",
" # using the \"method 1\" (cholesky decomposition)\n",
" sigma = jnp.linalg.cholesky(cov)\n",
" # create a vector of n_steps gaussian normal values\n",
" v = random.normal(rngkey, shape=(n_steps))\n",
" # convert these to fbm lines\n",
"\n",
" fbm_samples = sigma * v\n",
"\n",
" return t, fbm_samples\n",
"\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"An NVIDIA GPU may be present on this machine, but a CUDA-enabled jaxlib is not installed. Falling back to cpu.\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[[nan -0. -0. ... -0. -0. -0.]\n",
" [nan nan -0. ... -0. -0. -0.]\n",
" [nan nan nan ... -0. -0. -0.]\n",
" ...\n",
" [nan nan nan ... nan -0. -0.]\n",
" [nan nan nan ... nan nan -0.]\n",
" [nan nan nan ... nan nan nan]]\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA+kAAAH5CAYAAAD9dH/NAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAApxElEQVR4nO3de3hddYHv/0+SNikqaYVCQzGIMGirVHosthT14NBqFR61P7nZQUCmwjgCoxaRq3S81vGKDmAPjDPoAYYCCkexpw4Wb2Mjl7bMyK2jg1ykJoXBJqVAc1u/PzjEibSlqezkC329nmc9PF37u9b+LvJ9dvvO2tmpq6qqCgAAADDi6kd6AgAAAMBTRDoAAAAUQqQDAABAIUQ6AAAAFEKkAwAAQCFEOgAAABRCpAMAAEAhRo30BEZCf39/1q5dm5133jl1dXUjPR0AAABe4KqqyoYNGzJx4sTU12/5fvkOGelr165Na2vrSE8DAACAHcyDDz6Yl73sZVt8fIeM9J133jnJU/9zmpubR3g2AAAAvNB1dXWltbV1oEe3ZIeM9Kff4t7c3CzSAQAAGDbP9iPXPjgOAAAACiHSAQAAoBAiHQAAAAoh0gEAAKAQIh0AAAAKIdIBAACgECIdAAAACiHSAQAAoBAiHQAAAAoh0gEAAKAQIh0AAAAKIdIBAACgECIdAAAACiHSAQAAoBAiHQAAAAoh0gEAAKAQIh0AAAAKIdIBAACgECIdAAAACiHSAQAAoBAiHQAAAAoh0gEAAKAQIh0AAAAKIdIBAACgECIdAAAACiHSAQAAoBAiHQAAAAoh0gEAAKAQIh0AAAAKIdIBAACgECIdAAAACiHSAQAAoBAiHQAAAAoh0gEAAKAQIh0AAAAKIdIBAACgECIdAAAACiHSAQAAoBAiHQAAAAoh0gEAAKAQIh0AAAAKIdIBAACg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ra2gaNT5I5c+ZscXySdHZ2pq6uLuPGjdvs45s2bUpXV9egDQAAAEpT00h/5JFH0tfXlwkTJgzaP2HChLS3t2/2mPb29iGNf/LJJ3PmmWdm3rx5W/xuxKJFizJ27NiBrbW1dTuuBgAAAGrref3p7j09PTn66KNTVVW+/vWvb3Hc2Wefnc7OzoHtwQcfHMZZAgAAwLYZVcuTjx8/Pg0NDeno6Bi0v6OjIy0tLZs9pqWlZZvGPx3o999/f2666aatvqe/qakpTU1N23kVAAAAMDxqeie9sbEx06ZNy/Llywf29ff3Z/ny5Zk5c+Zmj5k5c+ag8Uly4403Dhr/dKD/6le/yg9/+MPsuuuutbkAAAAAGEY1vZOeJAsWLMgJJ5yQAw88MNOnT88FF1yQjRs35sQTT0ySHH/88dlzzz2zaNGiJMmHPvShHHLIIfnSl76Uww8/PFdddVVuu+22XHLJJUmeCvQjjzwyq1atyg033JC+vr6Bn1ffZZdd0tjYWOtLAgAAgJqoeaQfc8wxefjhh3P++eenvb09U6dOzbJlywY+HO6BBx5Iff0fbugffPDBufLKK3PeeeflnHPOyX777Zfrr78++++/f5LkoYceyne/+90kydSpUwc9149+9KO8+c1vrvUlAQAAQE3U/Pekl8jvSQcAAGA4FfF70gEAAIBtJ9IBAACgECIdAAAACiHSAQAAoBAiHQAAAAoh0gEAAKAQIh0AAAAKIdIBAACgECIdAAAACiHSAQAAoBAiHQAAAAoh0gEAAKAQIh0AAAAKIdIBAACgECIdAAAACiHSAQAAoBAiHQAAAAoh0gEAAKAQIh0AAAAKIdIBAACgECIdAAAACiHSAQAAoBAiHQAAAAoh0gEAAKAQIh0AAAAKIdIBAACgECIdAAA
"text/plain": [
"<Figure size 1200x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"key = random.PRNGKey(0)\n",
"steps = 1000\n",
"samples = 5\n",
"\n",
"H = 0.6\n",
"\n",
"t, fbm = gen_elevation_profile(key, steps, H)\n",
"plt.figure(figsize=(12,6))\n",
"print(fbm)\n",
"for i in range(fbm.shape[0]):\n",
" plt.plot(t, fbm[i], label=f\"Sample {i}\")"
]
},
{
"cell_type": "code",
2024-12-13 23:31:10 +00:00
"execution_count": 3,
2024-12-12 01:59:37 +00:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
2024-12-13 23:31:10 +00:00
"[<matplotlib.lines.Line2D at 0x7101983fd730>]"
2024-12-12 01:59:37 +00:00
]
},
2024-12-13 23:31:10 +00:00
"execution_count": 3,
2024-12-12 01:59:37 +00:00
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjgAAAGdCAYAAAAfTAk2AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAACR7klEQVR4nO3dd3xT9foH8E+Stunem5bSslp22WUoCLJcKC5EQUW8eHGB16t4XehP4epVrxdx4AAVEUURFBXZu2wKtEChZXTvvdKM8/vjm5PRpm3SnuRkPO/Xq6+cJqfJt6EkT57v832+Eo7jOBBCCCGEOBGp2AMghBBCCBEaBTiEEEIIcToU4BBCCCHE6VCAQwghhBCnQwEOIYQQQpwOBTiEEEIIcToU4BBCCCHE6VCAQwghhBCn4yb2AMSg0WhQUFAAPz8/SCQSsYdDCCGEEDNwHIfa2lpER0dDKm0/R+OSAU5BQQFiY2PFHgYhhBBCOiE3NxcxMTHtnuOSAY6fnx8A9gT5+/uLPBpCCCGEmKOmpgaxsbG69/H2uGSAw09L+fv7U4BDCCGEOBhzykuoyJgQQgghTocCHEIIIYQ4HQpwCCGEEOJ0KMAhhBBCiNOhAIcQQgghTocCHEIIIYQ4HQpwCCGEEOJ0KMAhhBBCiNOhAIcQQgghTocCHEIIIYQ4HQpwCCGEEOJ0KMAhhBBCiNMRPcDp0aMHJBJJq69FixaZPH/t2rWtzvX09LTxqAkhhBACADj/K5C+SexRtC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V021wJN1eKNhwirKkd/fHm7eOOwhayd7O83uCfw5HHg9pVA5CB2W4M
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"steps = 100\n",
"key = random.key(25)\n",
"\n",
"def uniform_window(n):\n",
" return jnp.ones(n)/n\n",
"\n",
"def generate_basic_terrain(key, steps=100, yscale=1.0, xscale=10.0, window=uniform_window, window_size=5):\n",
" key, split = random.split(key)\n",
" v = random.normal(split, shape=(steps))\n",
" y = jnp.cumsum(v) * yscale\n",
" # smooth with a windowing function\n",
" y_smooth = jnp.convolve(y, window(window_size), mode='same')\n",
" # compute the x-values\n",
" x = jnp.arange(steps) * xscale\n",
" return x,y_smooth\n",
"\n",
"\n",
"x,y = generate_basic_terrain(key)\n",
" \n",
"slope = jnp.atan(jnp.diff(y, prepend=0) / 10.0) * 180 / jnp.pi\n",
"plt.plot(x,y)\n",
"plt.plot(x, slope)"
]
},
{
"cell_type": "code",
2024-12-13 23:31:10 +00:00
"execution_count": 4,
2024-12-12 01:59:37 +00:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
2024-12-13 23:31:10 +00:00
"[<matplotlib.lines.Line2D at 0x7101ac7f1070>]"
2024-12-12 01:59:37 +00:00
]
},
2024-12-13 23:31:10 +00:00
"execution_count": 4,
2024-12-12 01:59:37 +00:00
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
2024-12-13 23:31:10 +00:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAiIAAAGdCAYAAAAvwBgXAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAByEUlEQVR4nO39eXhb9Zk3/r+PJEve5d2Ol+whIQtJSCAkQCmQshQotH06UyalhPKjpROmMGXaJsO0TJ8ODW15+uu0T0tbnoHSlqUr0NKypOwpgZCVLMTZ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H0CARmjXmZEiIiIKA3GfH7IsvLfrBEhIiKilBL1IZIE5FsYiBAREVEKqfUheWaYTFKaryYyBiJERERZSmRECgxaHwIwECEiIspao15jzxABGIgQERFlLaPPEAEYiBAREWUtl8EX3gEMRIiIiLKWmhGxMSNCREREKabtmjEqBiJERERZyiU277JYlYiIiFJtJBiIFLFYlYiIiFLN5Q4ezTAjQkRERKnGjAgRERGljVqsyvZdIiIiSjW1WJUZESIiIko1daAZa0SIiIgo1TjinYiIiNKGI96JiIgobURGpICBCBEREaXaqDfYvstdM0RERJRqI2627xIREVEa+PwBuH0BABxoRkRERCnmCh7LABzxTkRERCnmChaqmk0SrGbjvtwb98qIiIgoYdrx7pIkpflqomMgQkRElIVcGbDwDmAgQkRElJXUjhkD14cADESIiIiyEjMi4zz44IOQJAn33HNPqu6SiIgoZ40Ea0SMPFUVSFEg8t577+FnP/sZzjvvvFTcHRERUc4LZURyPBAZHh7Ghg0b8Mgjj6C8vFzvuyMiIiIALrVGJMePZjZt2oTrrrsO69ev1/uuiIiIKGgkQzIiuoZJTz/9NPbs2YP33nsvptu73W643W71/x0Oh16XRkRElNVCc0RyNCPS2tqKu+++G0888QTy8/Nj+jNbt26F3W5XP5qamvS6PCIioqw2EpysauSFd4COgcju3bvR3d2N888/HxaLBRaLBW+88QZ++MMfwmKxwO/3T/gzW7ZswdDQkPrR2tqq1+URERFltVFxNGPwGhHdru7KK6/EgQMHwj532223YdGiRfja174Gs3lihGaz2WCz2fS6JCIiygL+gIw/7jmLi+ZWoqmiMN2XY1gjmhHvRqZbIFJSUoKlS5eGfa6oqAiVlZUTPk9ERBSrbYc78ZXfv4+PLK7FI59dne7LMSwONCMiItLBoXalkaFjaDTNV2JsYsS70QeapTRMev3111N5d0RElIVO9AwDAAZd3jRfibGpGRHumiEiIkqe491KIDLEQGRSOd++S0RElGw+fwCne10AAKfbB58/kOYrMi7WiBARESXZ2YFReDTBh2PMl8arMbYRdcQ7j2aIiIiSQhzLCEOjPJ6JRJZlNSNi9PZdBiJERJQxRKGqMOjypOlKjM3jD8AXkAGwRoSIiChpJgQizIhEJKaqAsyIEGWsMe/ENQRElF7jj2YcDEQiEpt3rRYT8szGfqk39tURpckjb57EkvtfwlvHetJ9KUQUJMsyTvSMAADmVBUB4CyRaFzBQtUig2dDAAYiRBG9cLAD/oCM904PpPtSiCiob8SDoVEvJAlY0VQGgMWq0YyoharGrg8BGIgQTeD1B9QR0r3D7jRfDREJJ4LHMk3lhagpVRakMiMSmciIGL0+BGAgQjTBsa5huH3KnII+BiJZp7nTyX/XDHU8WKg6r7oIZQVWAMDgKLtmIlFbd23MiBBlnPfPDqr/3TvMJ7ls0tLnwjX//SZu+8V76b6UtHjnZB82PbkHe1oy88jxRLdSHzKvuhj2gjwALFaNZsS
2024-12-12 01:59:37 +00:00
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# we can compute the slope at any point along the terrain\n",
"plt.plot(x, slope)"
]
},
2024-12-13 23:31:10 +00:00
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"%run ../src/solarcarsim/physsim.py"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"CarParams(mass=800, frontal_area=1.3, drag_coeff=0.18, rolling_coeff=0.002, moter_eff=0.93, wheel_radius=0.23, max_speed=30.0, solar_area=5.0, solar_eff=0.2, n_motors=2, motor=MotorParams(kv=8.43, kt=1.1, resistance=100.0, friction_coeff=0.001, iron_coeff=0.001), battery=BatteryParams(shape=(36, 19), resistance=0.0126, initial_energy=66600.0))\n"
]
}
],
"source": [
"from functools import partial\n",
"import jax\n",
"p = CarParams()\n",
"print(p)\n",
"\n",
"\n",
"def control_fn(time):\n",
" # for the first minute, go at 15 m/s\n",
" return 10 + time * 10/60\n",
"\n",
"def wrapper(curr_state, _):\n",
" vel = control_fn(curr_state[1])\n",
" next_state = forward(curr_state, 0.1, vel, p)\n",
" return next_state, next_state\n",
"\n",
"state_init = jnp.array([0.0, 0.0, 45.5e6])\n",
"_, out = jax.lax.scan(wrapper, state_init, None, length=1000)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[<matplotlib.lines.Line2D at 0x7101ac1667b0>]"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAlkAAAGsCAYAAADuT7JwAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAB7QUlEQVR4nO3deVwU5R8H8M/uAssNci6ngiiIgLeIt2kqmXl1aHibpqFpVprdZqVph5rmlWeeWV5ZWd54ICKIoCgKIpccAnLLArvz+4Pc4qcmGMvA8nm/XvPSnXl29zujMh9nnnkeiSAIAoiIiIioVknFLoCIiIhIFzFkEREREWkBQxYRERGRFjBkEREREWkBQxYRERGRFjBkEREREWkBQxYRERGRFjBkEREREWkBQxYRERGRFjBkEREREWkBQxYRERFVW0hICAYPHgxHR0dIJBLs27evRu//+OOPIZFIHlhMTEy0U7CIGLKIiIio2oqLi9GmTRusXLnyid7/1ltvIT09vcri7e2NF154oZYrFR9DFhEREVVbYGAgPv30UwwbNuyh25VKJd566y04OTnBxMQE/v7+OHHihGa7qakpFAqFZsnMzERsbCwmTZpUR3tQdxiyiIiIqNZMnz4doaGh2LlzJ6Kjo/HCCy9g4MCBuHHjxkPbf//992jZsiV69OhRx5VqH0MWERER1Yrk5GRs3LgRu3fvRo8ePdC8eXO89dZb6N69OzZu3PhA+9LSUmzbtk0nr2IBgJ7YBRAREZFuiImJgUqlQsuWLausVyqVsLa2fqD93r17UVhYiHHjxtVViXWKIYuIiIhqRVFREWQyGSIiIiCTyapsMzU1faD9999/j2effRb29vZ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": {},
"output_type": "display_data"
}
],
"source": [
"fig, ax1 = plt.subplots()\n",
"ax2 = ax1.twinx()\n",
"x = out[:,1]\n",
"ax1.plot(x, out[:,0], label=\"position\")\n",
"ax2.plot(x, out[:,2], label=\"energy\")\n"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
"x = jnp.linspace(0,30, 1000)\n",
"dragf = drag_force(x, 1.3, 0.18, 1.184)"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[<matplotlib.lines.Line2D at 0x7101a4010b30>]"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAigAAAGdCAYAAAA44ojeAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABA4ElEQVR4nO3dd3wUdeLG8c+mbUIqSUiDBALSS+gxdiUnqKcgcIKioiKcCipiAfwdKJ6Ih54iNs6KBbGdoOLJHaKAJQQIvYUWIJQEQshuCqk7vz+iexdFCLDJ7CbP+/XaV5LZyeTJMLAPs9/5jsUwDAMRERERN+JldgARERGRX1NBEREREbejgiIiIiJuRwVFRERE3I4KioiIiLgdFRQRERFxOyooIiIi4nZUUERERMTt+Jgd4Gw4HA4OHTpEcHAwFovF7DgiIiJSC4ZhUFhYSFxcHF5epz5H4pEF5dChQ8THx5sdQ0RERM5CdnY2LVq0OOU6HllQgoODgepfMCQkxOQ0IiIiUht2u534+Hjn6/ipeGRB+eVtnZCQEBUUERERD1Ob4RkaJCsiIiJuRwVFRERE3I4KioiIiLgdFRQRERFxOyooIiIi4nZUUERERMTtqKCIiIiI21FBEREREbejgiIiIiJuRwVFRERE3I4KioiIiLgdFRQRERFxOyooIiIi4nTYdoKbXl/JjtxCU3OooIiIi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UidWrV9O7d28AFi9ezNVXX82BAweIi4s77c+12+2EhoZis9kICQk52/giIiJ1osphcOtb6fy46xjtooN
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.plot(x, dragf)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
"%run ../src/solarcarsim/noise.py"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
"key = random.key(123)\n",
"fractal_tex = generate_noise_texture(key, 256, 256, \"fractal\")"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.image.AxesImage at 0x7101a4373b30>"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAa4AAAGiCAYAAAC/NyLhAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAADqIElEQVR4nO29fcwtV3Ue/sx5wTfm49o1xr52AsSQhI/wEQrEuUpC02JhG0pDcaVArBQiBAq1o4ITQh0RCGlVtzRqoqQkqFIFiQT5QAqgoIRfHRNMaYwTnCACJBZGtIbiaxKQfcEEY79n//6Y2XvWXnuttdeemfO+99x71quj98z+njnn7GeeZ629pwshBOxsZzvb2c52tiW2OuwB7GxnO9vZznbWYjvg2tnOdraznW2V7YBrZzvb2c52tlW2A66d7WxnO9vZVtkOuHa2s53tbGdbZTvg2tnOdraznW2V7YBrZzvb2c52tlW2A66d7WxnO9vZVtkOuHa2s53tbGdbZTvg2tnOdraznW2VHRpwve1tb8N3fud34tu+7dtw6aWX4s///M8Payg729nOdrazLbJDAa7f+73fw3XXXYc3v/nN+Mu//Es84xnPwOWXX44vf/nLhzGcne1sZzvb2RZ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ou9rP+yV7ItEGEpsYo5cGG2KRDjVp1b74dTkwtGvRyIPI5gBaRIsfFrkmAdl9BNBP5sHpUxmKcIwHktlzNOslzUn4oa2eZtaXSeYaYAl5Qfqz5L6sGRECwAt8KqB2AFbDWyoaYClteMJ7Gg1jQWltArb6vPkKEIKUoAOWhpg5YEdIfs
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.imshow(fractal_tex)"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [],
"source": [
"import pyvista as pv\n",
"import numpy as np\n",
"a = np.array(fractal_tex)\n"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/saji/Documents/Code/solarcarsim/.venv/lib/python3.12/site-packages/pyvista/plotting/texture.py:682: UserWarning: Expected `image` dtype to be ``np.uint8``. `image` has been copied and converted to np.uint8.\n",
" warnings.warn(\n"
]
}
],
"source": [
"tex = pv.numpy_to_texture(a)\n"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/saji/Documents/Code/solarcarsim/.venv/lib/python3.12/site-packages/pyvista/core/utilities/points.py:55: UserWarning: Points is not a float type. This can cause issues when transforming or applying filters. Casting to ``np.float32``. Disable this by passing ``force_float=False``.\n",
" warnings.warn(\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAZoAAAGNCAYAAAAo1bdAAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOz9d3Bs+X3eCX9O54ROaHRAzrg5h7n3znCGFLV0Etdle5cuy0HUK7tESy5Z3HoVVqnekiWvS2XZ2pVWfEW/WkmW15ZkW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QkEw8h714HxdC+KTjaa/x01oi7PXi+Sj30Xr3m6JMreBRUIjmE4a9FsuVSoWpqSkikQgXL16Uu5gAOZV2mPikRzTHCc+6qD+pJUJ9IPRRlgh1M7ilpSXcbjd2u12xvVZwIBSi+YTgIIvlZDLJ6OgoJpOJW7duycZddRzF4v00x3xc+kfBo3GY1+4gS4RMJiMTz0dZIqjVahKJBK2trU2214r7qIJGKETzCcBei2VBEFhdXWVxcZGBgQH6+voO/IK/zIgmn88/lWSKEtE046hN4CwWCxaLhc7OzsdaItT9ig4ygVOIRwEoRPOxRuNsRD1VViwWmZiYIJPJcPXqVex2+yOf/zIimvqA6PLyMgA2mw2n0ymnZz6KeBSi2cWLjAYfZ4mQz+eZnJyUP8e6JUKdfBT3UQUK0XxMcdBsTCQSYWJiAofDwc2bNx8rI/OiI5pCocD4+Di5XI4rV64gCMK+9EyjqKTZbJYXHmUB2o+XdU32WiK899579PX1USqVPtIS4UncRxXi+WRCIZqPIQ6yWJ6fn2d9fZ2TJ0/S0dHxRF/QFxnRRCIRxsfHcTgcXLhwQd7
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"x = np.arange(0,256)\n",
"y = np.arange(0,256)\n",
"x, y = np.meshgrid(x, y)\n",
"fig, ax = plt.subplots(subplot_kw={\"projection\": \"3d\"})\n",
"ax.plot_surface(x,y,a)\n",
"grid=pv.StructuredGrid(x,y, a * 100)"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[<matplotlib.lines.Line2D at 0x7100e506cf80>]"
]
},
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAigAAAGdCAYAAAA44ojeAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBI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gwJ8sULd0yQuiRbK8pneRU4V9cscTVEROQuGFA8yL92FeHrgmqoFDKs+/EkDPJXSV0SJsQE4ZoRg2Eyi/jXN6elLoeIiNwEA4qH2H2qBn/ffgoA8PTCsRgXrZW4ogsemWVpRfnkYBlK61skroaIiNwBA4oHKK1vwaPvH4IoAndPicGdk2OkLqmbSXGDkJYQAqNZxCcHy6Quh4iI3AADigf40+fH0dDSifHRWvxhwRipy+nRbV27KH9+uAKiKEpcDRERuToGFDdX39yBXSerAQAv3DEBPkq5xBX1bPaYcKjkMpyuacYJnXss3CaKIjYeLEPWmTqpSyEi8joMKG7uy6OVMJpFjB2iwYjwQKnLuSSNjxIzRw4GAGw5UiFxNVcmiiL+vOU4Vnx4GHe9th/PfnUCRpNZ6rKIiLxGnwPKnj17sGDBAkRFRUEQBGzatOmS5/785z+HIAh48cUXuz1fX1+PxYsXQ6PRICgoCEuWLIHBwIW8+mPzYcuX/U0ToiSu5Mpu7Krx88OVLt/N88+vC/Hmt2dtf163+zR+9HoWqvRt0hVFRORF+hxQmpubMWHCBKxdu/ay53366afYv38/oqJ++MW5ePFi5OfnY/v27diyZQv27NmDpUuX9rUUr1fR0Irs4no
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"key = random.key(123)\n",
"key, subkey = random.split(key)\n",
"y = generate_elevation_profile(subkey, 100, scale=100)\n",
"plt.plot(y)"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.image.AxesImage at 0x7100e4f72db0>"
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAaAAAAGgCAYAAADsNrNZAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPY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a/We2Lcq9UnFdTTxSdUWP6ZUAGDKMeT163VwbY9uH5TH/jPzWf22XdCA5jBA3oABrAvSa4YGOawZCvGFe0ixsPj6oPygeEyO7dC+dn15CWzvzcZaVHxWEpoQyiBwzXuXZqokt6tHOvedOazROhqM0dSt1rZccFxcU6e/jpQG5OhWeOmhzhP1J/SuzD0utEfYr9Y1qT64VWrhExAhhJBW4ARECCGkFTgBEUIIaYWZ1YDKTiayX/vRyyJS64B02677Ab0Fy80WWoOAbd2gMDRR51GlddHWXtAPCsh1aD2h60Tlu90tfaz31fTlf02f1nUaaEn4nui7hu2uU/obNSG9tsfTfLA/pQHhuiCPedS/1DdWQk2CYUCdak69rveum9TGtUoe+jvYA31D5zI2vnFQWtpc843kSm3S5us2UbuBDmLaeFzjmaf+AJqJ+R3x1jwl1gFFJS9wfQ629TomZ+0O9uO2qPlkI/CFVP1aLwpTyqN8AiKEENIKnIAIIYS0wsyG4KqOSLZ/dDqUZtOwYT+9rZdmLVDVVCAkl6rM2MRSXoccTPQBqlLCM3Ds5JGonqpeF/n04SDE2AVhqEOH1RLHihyLEtVeCydF2IbVsJrq+Jkfw2hYjsELq9mQ1rgfQ264b9EollQfoyghxlO
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"key, subkey = random.split(key)\n",
"y = generate_wind_field(subkey, 100, 100)\n",
"plt.imshow(y)"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Text(0, 0.5, 'Slope (rad)')"
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABKUAAAJQCAYAAABfMtfbAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQV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z0Uo6OjWL9+Pd797ndj3759xvaf+tSnAJghdIo0TXHllVfi6U9/OsbGxrBy5UpceOGFeOqpp4x+SCnx4Q9/GOvWrcPcuXPxohe9yOlrG5x55pl4xjOegTvvvBMvetGLMHfuXKxduxYf+9jHijJbt27F0NAQPvCBDzjb//KXv4QQAldddRUAOqeUauPmm2/GC1/4QsydOxd/8Ad/AAB47LHH8Ju/+ZtYuXIlxsbGcOKJJ+Lzn/+80caDDz4IIQQ+/vGP4y//8i9x5JFHYnR0FKeccgr++7//2yirzt/DDz+MV77ylZg/fz7Wrl1bnJPbbrsNL37xizFv3jwcdthhuOaaa5x92r59Oy655BKsX78eo6OjOOqoo/DRj34UaZrW7lPV9cAwDMMwzOyAnVIMwzAMMwv55je/iaOOOgqnnXZa9DZ33HEHnve852Ht2rV473vfi3nz5uGrX/0qzj33XPzDP/wDXv3qVxvl3/nOd2LJkiV4//vfjwcffBBXXnklLr74YnzlK18pyvzd3/0d3vKWt+Dss8/GRz/6Uezduxef/vSn8fznPx+33HILNmzYUJSdmprC2Wefjec///n4+Mc/Xjh6rr32WuzduxfveMc7sHTpUtx000345Cc/iUcffRTXXnstAODCCy/Epk2b8J3vfAd/93d/5+zbhRdeiM997nN461vfine961144IEHcNVVV+GWW27BD3/4QwwPDwMALr/8cnz4wx/GK17xCrziFa/AT3/6U7zsZS/DxMRE9HHcv38/tm3b5ixfuHAhRkZGis9PPfUUfvVXfxWvec1r8LrXvQ5f+9rX8Pu///s44YQT8PKXvxwrV67EGWecga9+9at4//vfb9T1la98BZ1OB7/xG78R7MsTTzyBl7/85TjvvPPwxje+EStXrsS+fftw5pln4t5778XFF1+Mww8/HNdeey0uuOACbN++Hb/zO79j1HHNNddg165duPDCCyGEwMc+9jG85jWvwf33318cNwDodrt4+ctfjhe+8IX42Mc+hi996Uu4+OKLMW/ePPyf//N/cP755+M1r3kNrr76arz5zW/G6aefjsMPPxxA5uA644wzsHHjRlx44YU49NBD8aMf/QiXXXYZNm/ejCuvvLJWn6quB4ZhGIZhZgmSYRiGYZhZxY4dOyQAee655zrrnnrqKfn4448Xf3v37i3WveQlL5EnnHCC3L9/f7EsTVP53Oc+Vx599NHFss9+9rMSgDzrrLNkmqbF8ne/+92y0+nI7du3Syml3LVrl1y8eLF829veZvRhy5YtctGiRcbyt7zlLRKAfO973+v0We+j4oorrpBCCPnQQw8Vyy666CJJfXX5j//4DwlAfulLXzKWX3fddcbyxx57TI6MjMhzzjnH2K8/+IM/kADkW97yFqduGwDev7//+78vyp1xxhkSgPzCF75QLBsfH5erVq2Sr33ta4tln/nMZyQAedtttxntHH/88fLFL35x8fmGG26QAOQNN9zgtHH11Vcb21555ZUSgPziF79YLJuYmJCnn366nD9/vty5c6eUUsoHHnhAApBLly6VTz75ZFH2n//5nyUA+Y1vfKNYps7fRz7ykWLZU089JefMmSOFEPLLX/5ysfyuu+6SAOT73//+YtmHPvQhOW/ePHn33XcbfX3ve98rO52OfPjhh2v3yXc9MAzDMAwze+DwPYZhGIaZZezcuRMAMH/+fGfdmWeeieXLlxd/KsTpySefxL//+7/jda97HXbt2oVt27Zh27ZteOKJJ3D22WfjnnvuwcaNG4263v72txshUS94wQvQ7Xbx0EMPAQC+853vYPv27XjDG95Q1Ldt2zZ0Oh2cdtppuOGGG5z+veMd73CWzZkzp3i/Z88ebNu2Dc997nMhpcQtt9xSeTyuvfZaLFq0CC996UuNfpx00kmYP39+0Y/vfve7mJiYwDvf+U5jvy655JLKNnRe9apX4Tvf+Y7z96IXvcgoN3/+fCP31MjICE499VTcf//9xbLXvOY1GBoaMtxnt99+O+688068/vWvr+zL6Ogo3vrWtxrL/vVf/xWrVq3CG97whmLZ8PAw3vWud2H37t34/ve/b5R//etfjyVLlhSfX/CCFwCA0U/Fb/3WbxXvFy9ejGOPPRbz5s3D6173umL5sccei8WLFxvbX3vttXjBC16AJUuWGOforLPOQrfbxQ9+8IPGfWIYhmEYZvbC4XsMwzAMM8tYsGABAGD37t3Ous985jPYtWsXtm7daggi9957L6SUeN/73of3ve99ZL2PPfYY1q5dW3w+9NBDjfVKJFB5mu655x4AwItf/GKyvoULFxqfh4aGsG7dOqfcww8/jMsvvxxf//rXnRxQO3bsIOvWueeee7Bjxw6sWLGCXP/YY48BQCGmHX300cb65cuXGwJIFevWrcNZZ50VVc7Oc7RkyRL8/Oc/Lz4vW7YML3nJS/DVr34VH/rQhwBkoXtDQ0N4zWteU9nG2rVrjZBBINvPo48+2klyf9xxxxXrdarOs2JsbAzLly83li1atIjcz0WLFhnb33PPPfj5z3/ubK9Q56hunxiGYRiGmd2wKMUwDMMws4xFixZh9erVuP322511KsfUgw8+aCxXyaR/93d/F2effTZZ71FHHWV87nQ6ZDkppVHn3/3d32HVqlVOuaEh82vG6OioI5R0u1289KUvxZNPPonf//3fx9Oe9jTMmzcPGzduxAUXXGAkwfaRpilWrFiBL33pS+R6nxDSb6qOn+K8887DW9/6Vtx666141rOeha9+9at4yUtegmXLllW2obvM+t1PX7mY7dM0xUtf+lK85z3vIcs
"text/plain": [
"<Figure size 1200x600 with 3 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"%run ../src/solarcarsim/physsim.py\n",
"from jax import random\n",
"wind, elevation, slope = make_environment(random.key(123))\n",
"fig, (ax1, ax2) = plt.subplots(1,2, figsize=(12,6))\n",
"fig.set_tight_layout('auto')\n",
"fig.suptitle(\"Generated Environment\")\n",
"\n",
"ax1.imshow(wind, aspect='auto')\n",
"ax1.set_ylabel(\"Time (sec)\")\n",
"ax1.set_xlabel(\"Distance (m)\")\n",
"ax_slope = ax2.twinx()\n",
"ax2.plot(elevation)\n",
"ax2.set_ylabel(\"Elevation (m)\")\n",
"ax2.set_xlabel(\"Distance (m)\")\n",
"ax_slope.plot(slope, color='r')\n",
"ax_slope.set_ylabel(\"Slope (rad)\")"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.image.AxesImage at 0x7100e4dcb050>"
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAh8AAAERCAYAAADbv8U8AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAACzYElEQVR4nO39f+wlR3UmjD/Vd+yxwfYYjJixgw2TCMkQyIafxoA2q+A3VpbvLixWdpGcFfmhsEkMwVgKwUlMxCZgYLMJC3EgoKxDvgthg7SQwKsl4p0Er1CMDSawYZMY9gUtFmSGjTb2EMOMZ27X+0d3VZ86dU796Nv3fu79TB9p5nZXnTpV3Z/uqqefOnXKWGstZplllllmmWWWWTYkzV43YJZZZplllllmObdkBh+zzDLLLLPMMstGZQYfs8wyyyyzzDLLRmUGH7PMMssss8wyy0ZlBh+zzDLLLLPMMstGZQYfs8wyyyyzzDLLRmUGH7PMMssss8wyy0ZlBh+zzDLLLLPMMstGZQYfs8wyyyyzzDLLRmUGH7PMMssss8wyy0ZlbeDjjjvuwJOe9CRccMEFuOaaa3Dvvfeuq6pZZplln8jcb8wyy7khawEf//k//2fccsst+JVf+RV87nOfwz/6R/8I119/Pb75zW+uo7pZZpllH8jcb8wyy7kjZh0by11zzTV4znOeg9/6rd8CALRtiyuvvBKvfvWr8frXvz5Ztm1bfOMb38DFF18MY8zUTZtlllkKxFqLb33rW7jiiivQNJuZnV2l33D6c98xyyx7JzX9xoGpK3/kkUdw33334dZbb/VpTdPguuuuw9133x3pnz59GqdPn/bnX//61/HUpz516mbNMsssI+SBBx7AE57whLXXU9tvAHPfMcss2yol/cbk4OPv/u7vsFwucfjw4SD98OHD+Ju/+ZtI//bbb8cb3/jGKP31x34A9sJH4Yxd4HR7AI+0B3C6XeCR9gDO2gVOLQ+gtQanlwewbBs80i5wZrlAaw0eWS7Qtg3Otg3a1mC5NLDLBq01aJcNYAF7tvtF/2uWBmgBYw3ME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8AOpBwZkUHZq00dzbt6pPLpcBGlz8ecHS/9UzHGMARtklmOkoBx9QsRwnYyLEbOaCRYjVqAMamwAVPS4ELyaYOPuQywbRLu4fTLk5e9apXVdOlKWmMRcNe/MbEHYETo+VFCKQTa7qhP0qHMC3i/o35QBw7HjCJgEyyThN9zdrGdCtiXH7qYnqAEdkyGQAS2AjTAiaE1uNEWhGjtS0hWdDRKYn51VMrKR+OqUDHqmCjlB3ZI0fTKfqNfsHZZMIBh+RBMgXoAFZnOjq7+goWyWbYpnJHUm26Jbg2wflzDPCoARSbBh3VfhUJ8FJSvqjOqETabjoPYp5UvmZI3PPVLpsSYzjrQRwuCLsx5A+HxQO9Ib+Svkun4MUYdO6kfV0NugUjxjWvU5RZl57paHpbni0x3QDX2GHqxZgBOHDHU89mkDTKfnC2g/p/CACku46B8fDCGQUOUNw9kFgRRZJe1TmgwXQmnVLRwMZYoKE60Faml8oWr3LJySPW4hECGGKvsVhyLqnSkyqBjMFeOBB2OuPARvc73dSKs1e6ZDYHOFZlOsayHGPBRg5ojJl+scLfWdNdxenTl2HnYwBLCcCI9Ui6oN9uA/OxTln0UyxlDqfrnb9OAZNgKqbEYVWTgHlAvyRW0OsBR9QTSr4eEtuhOMsELIXJA5DQJmE8Ir8UAaAgAyhKpBJ0RHWWrFYpmFpRQQevP6mXACQl6aX5q+pvkcRAYHUbgOxHFjAeArvR6RhRZwrgwe3mmI5VlsyK9iSgwdsiAgwNjDTh/aoEHtL0y16Ajm0AHPl8qPlJViShX+MutrXgozFd7IgmQ+S4qRf3a9ADDuGPZ3ok0PlikJE/WNnimIE
"text/plain": [
"<Figure size 640x480 with 2 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# testing the indexing into the wind array.\n",
"# given an array of shape (10,2)\n",
"# return an array of (10,100,100)\n",
"key = random.key(0)\n",
"@jit\n",
"def lookup(x):\n",
" return lax.dynamic_slice(wind, x, (100, 100))\n",
"vlookup = vmap(lookup)\n",
"res = vlookup(jnp.array([[10,20], [9999, 600]]))\n",
"\n",
"fig, (ax1, ax2) = plt.subplots(1,2)\n",
"ax1.imshow(res[0])\n",
"ax2.imshow(res[1])"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [],
"source": [
"%run ../src/solarcarsim/gym.py\n",
"import gymnasium as gym\n",
"from gymnasium.wrappers.jax_to_numpy import JaxToNumpy\n",
"from gymnasium.wrappers.vector import JaxToNumpy as VJaxToNumpy"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/saji/Documents/Code/solarcarsim/.venv/lib/python3.12/site-packages/stable_baselines3/common/env_checker.py:271: UserWarning: Your observation wind has an unconventional shape (neither an image, nor a 1D vector). We recommend you to flatten the observation to have only a 1D vector or use a custom policy to properly process the data.\n",
" warnings.warn(\n",
"/home/saji/Documents/Code/solarcarsim/.venv/lib/python3.12/site-packages/gymnasium/utils/env_checker.py:384: UserWarning: \u001b[33mWARN: The environment (<JaxToNumpy<SolarRaceV1 instance>>) is different from the unwrapped version (<SolarRaceV1 instance>). This could effect the environment checker as the environment most likely has a wrapper applied to it. We recommend using the raw environment for `check_env` using `env.unwrapped`.\u001b[0m\n",
" logger.warn(\n",
"/home/saji/Documents/Code/solarcarsim/.venv/lib/python3.12/site-packages/gymnasium/utils/env_checker.py:434: UserWarning: \u001b[33mWARN: Not able to test alternative render modes due to the environment not having a spec. Try instantiating the environment through `gymnasium.make`\u001b[0m\n",
" logger.warn(\n"
]
}
],
"source": [
"env = SolarRaceV1()\n",
"wrapped_env = JaxToNumpy(env)\n",
"env.reset()\n",
"from stable_baselines3.common.env_checker import check_env\n",
"from gymnasium.utils.env_checker import check_env as gym_check_env\n",
"check_env(wrapped_env)\n",
"gym_check_env(wrapped_env)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Using cuda device\n",
"Wrapping the env with a `Monitor` wrapper\n",
"Wrapping the env in a DummyVecEnv.\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/saji/Documents/Code/solarcarsim/.venv/lib/python3.12/site-packages/stable_baselines3/common/buffers.py:605: UserWarning: This system does not have apparently enough memory to store the complete replay buffer 80.85GB > 30.69GB\n",
" warnings.warn(\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"----------------------------------\n",
"| rollout/ | |\n",
"| ep_len_mean | 601 |\n",
"| ep_rew_mean | 1.25e+12 |\n",
"| time/ | |\n",
"| episodes | 4 |\n",
"| fps | 77 |\n",
"| time_elapsed | 31 |\n",
"| total_timesteps | 2404 |\n",
"| train/ | |\n",
"| actor_loss | -2.13e+10 |\n",
"| critic_loss | 1.37e+15 |\n",
"| ent_coef | 1.92 |\n",
"| ent_coef_loss | -6.08 |\n",
"| learning_rate | 0.0003 |\n",
"| n_updates | 2303 |\n",
"----------------------------------\n",
"----------------------------------\n",
"| rollout/ | |\n",
"| ep_len_mean | 601 |\n",
"| ep_rew_mean | 1.26e+12 |\n",
"| time/ | |\n",
"| episodes | 8 |\n",
"| fps | 75 |\n",
"| time_elapsed | 63 |\n",
"| total_timesteps | 4808 |\n",
"| train/ | |\n",
"| actor_loss | -4.31e+10 |\n",
"| critic_loss | 5e+15 |\n",
"| ent_coef | 3.95 |\n",
"| ent_coef_loss | -12.9 |\n",
"| learning_rate | 0.0003 |\n",
"| n_updates | 4707 |\n",
"----------------------------------\n",
"----------------------------------\n",
"| rollout/ | |\n",
"| ep_len_mean | 601 |\n",
"| ep_rew_mean | 1.27e+12 |\n",
"| time/ | |\n",
"| episodes | 12 |\n",
"| fps | 75 |\n",
"| time_elapsed | 95 |\n",
"| total_timesteps | 7212 |\n",
"| train/ | |\n",
"| actor_loss | -5.97e+10 |\n",
"| critic_loss | 1.1e+16 |\n",
"| ent_coef | 8.13 |\n",
"| ent_coef_loss | -19.6 |\n",
"| learning_rate | 0.0003 |\n",
"| n_updates | 7111 |\n",
"----------------------------------\n",
"----------------------------------\n",
"| rollout/ | |\n",
"| ep_len_mean | 601 |\n",
"| ep_rew_mean | 1.27e+12 |\n",
"| time/ | |\n",
"| episodes | 16 |\n",
"| fps | 75 |\n",
"| time_elapsed | 126 |\n",
"| total_timesteps | 9616 |\n",
"| train/ | |\n",
"| actor_loss | -7.87e+10 |\n",
"| critic_loss | 1.94e+16 |\n",
"| ent_coef | 16.7 |\n",
"| ent_coef_loss | -26.4 |\n",
"| learning_rate | 0.0003 |\n",
"| n_updates | 9515 |\n",
"----------------------------------\n"
]
},
{
"data": {
"text/plain": [
"<stable_baselines3.sac.sac.SAC at 0x7100e4ca9730>"
]
},
"execution_count": 24,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# import a model and try it out!\n",
"from stable_baselines3 import PPO\n",
"model = PPO(\"MultiInputPolicy\", wrapped_env, verbose=1)\n",
"model.learn(total_timesteps=1_000_000)\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Array([[[-4.9999666, -5.031969 , -5.063982 , ..., -6.714849 ,\n",
" -6.71299 , -6.7111654],\n",
" [-4.9998884, -5.031891 , -5.0639033, ..., -6.705859 ,\n",
" -6.7038655, -6.701909 ],\n",
" [-4.9997377, -5.03174 , -5.0637527, ..., -6.6968226,\n",
" -6.694696 , -6.692607 ],\n",
" ...,\n",
" [-4.8104963, -4.840162 , -4.869858 , ..., -6.505874 ,\n",
" -6.499703 , -6.4934487],\n",
" [-4.8117733, -4.8413825, -4.871023 , ..., -6.511339 ,\n",
" -6.5052385, -6.499054 ],\n",
" [-4.812991 , -4.8425455, -4.8721304, ..., -6.5165534,\n",
" -6.510523 , -6.504408 ]]], dtype=float32)"
]
},
"execution_count": 41,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"pos = jnp.array([0])\n",
"time = jnp.array([0])\n",
"x = jnp.stack([pos,time], axis=1)\n",
"vlookup(x)"
]
},
2024-12-12 01:59:37 +00:00
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"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.12.7"
}
},
"nbformat": 4,
"nbformat_minor": 2
}