Skip to content

Commit

Permalink
adjusted notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
marvin-steinke committed Jun 18, 2024
1 parent 0660b43 commit 91239e4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions examples/controller_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@
" super().__init__()\n",
" self.nodes = nodes\n",
" # save original node power consumption\n",
" self.node_p = {node.name: node.at() for node in self.nodes}\n",
" self.node_p = {node.name: node.now() for node in self.nodes}\n",
"\n",
" def step(self, time: int, p_delta: float, e_delta: float, actor_infos: dict) -> None:\n",
" for node in self.nodes:\n",
" new_power = self.node_p[node.name]\n",
" if p_delta < 0:\n",
" new_power *= 0.3\n",
" node.set_power(new_power)"
" node.set_value(new_power)"
]
},
{
Expand Down Expand Up @@ -93,8 +93,8 @@
"environment = vs.Environment(sim_start=\"2022-06-09 00:00:00\")\n",
"\n",
"nodes: list = [\n",
" vs.MockSignal(p=200),\n",
" vs.MockSignal(p=250),\n",
" vs.MockSignal(v=200),\n",
" vs.MockSignal(v=250),\n",
"]\n",
"monitor = vs.Monitor() # Stores simulation result on each step\n",
"load_balancer = SimpleLoadBalancingController(nodes=nodes)\n",
Expand Down
4 changes: 2 additions & 2 deletions examples/signal_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
}
],
"source": [
"signal.at(\"2020-01-01T00:00:00\", column=\"solar\")"
"signal.now(at=\"2020-01-01T00:00:00\", column=\"solar\")"
]
},
{
Expand Down Expand Up @@ -157,7 +157,7 @@
],
"source": [
"dataset_signal = vs.HistoricalSignal.load(\"solcast2022_global\", params={\"scale\": 2.0, \"start_time\":\"2020-06-12T00:00:00\"})\n",
"dataset_signal.at(\"2020-06-27T13:46:53\", column=\"Berlin\")"
"dataset_signal.now(at=\"2020-06-27T13:46:53\", column=\"Berlin\")"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion examples/sil_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
" self._p = 0.0\n",
" Thread(target=self._collect_loop, daemon=True).start()\n",
"\n",
" def at(self, dt=None):\n",
" def now(self, at=None) -> float:\n",
" return self._p\n",
"\n",
" def _collect_loop(self) -> None:\n",
Expand Down

0 comments on commit 91239e4

Please sign in to comment.