Skip to content

Commit

Permalink
Decided to run the notebooks and commit the metadata to make them wor…
Browse files Browse the repository at this point in the history
…k in RTD.
  • Loading branch information
gialmisi committed Jun 17, 2020
1 parent 0d724f0 commit 0d223f7
Show file tree
Hide file tree
Showing 2 changed files with 256 additions and 121 deletions.
88 changes: 68 additions & 20 deletions docs/notebooks/nautilus_navigator.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -42,9 +42,15 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [],
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": "<desdeo_mcdm.interactive.NautilusNavigator.NautilusNavigatorRequest object at 0x7ff8807cfd60>\ndict_keys(['message', 'ideal', 'nadir', 'reachable_lb', 'reachable_ub', 'reachable_idx', 'step_number', 'steps_remaining', 'distance', 'allowed_speeds', 'current_speed', 'navigation_point'])\n"
}
],
"source": [
"req_first = method.start()\n",
"\n",
Expand All @@ -65,9 +71,15 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {},
"outputs": [],
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": "Please supply aspirations levels for each objective between the upper and lower bounds as `reference_point`. Specify a speed between 1-5 as `speed`. If going to a previous step is desired, please set `go_to_previous` to True, otherwise it should be False. Lastly, if stopping is desired, `stop` should be True, otherweise it should be set to False.\n"
}
],
"source": [
"print(req_first.content[\"message\"])"
]
Expand All @@ -81,17 +93,23 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"metadata": {},
"outputs": [],
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": "[1. 1.]\n[ 100. 10000.]\n"
}
],
"source": [
"print(req_first.content[\"reachable_lb\"])\n",
"print(req_first.content[\"reachable_ub\"])"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -112,9 +130,15 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 6,
"metadata": {},
"outputs": [],
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": "[3.02040816 9.12286547]\n[ 100. 10000.]\n"
}
],
"source": [
"req_first.response = response\n",
"req_snd = method.iterate(req_first)\n",
Expand All @@ -134,9 +158,15 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 7,
"metadata": {},
"outputs": [],
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": "[ 11.10204082 449.61307788]\n[ 81.81632653 8081.64306539]\n30\n"
}
],
"source": [
"previous_requests = [req_first, req_snd]\n",
"req = req_snd\n",
Expand All @@ -160,9 +190,15 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 8,
"metadata": {},
"outputs": [],
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": "[ 5.04081633 123.25531029]\n[ 91.91836735 9208.16493128]\n14\n"
}
],
"source": [
"# fetch the 14th step saved previously\n",
"req_14 = previous_requests[13]\n",
Expand All @@ -184,9 +220,15 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 9,
"metadata": {},
"outputs": [],
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": "Old 30th step\n[ 11.10204082 449.61307788]\n[ 81.81632653 8081.64306539]\n30\nNew 30th step\n[ 11.10204082 368.01332778]\n[ 81.81632653 8081.64306539]\n30\n"
}
],
"source": [
"req_14_new = method.iterate(req_14)\n",
"req = req_14_new\n",
Expand Down Expand Up @@ -221,9 +263,15 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 10,
"metadata": {},
"outputs": [],
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": "19\n"
}
],
"source": [
"while method._step_number < 100:\n",
" req.response = new_response\n",
Expand Down Expand Up @@ -262,9 +310,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.2-final"
"version": "3.8.3-final"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
}

0 comments on commit 0d223f7

Please sign in to comment.