Skip to content

Commit

Permalink
renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
Theodore-Chatziioannou authored and Theodore-Chatziioannou committed May 24, 2023
1 parent 1429e53 commit 9b4600d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
22 changes: 11 additions & 11 deletions examples/15_Advanced_Choice.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"source": [
"import pandas as pd\n",
"from pam.read import read_matsim\n",
"from pam.planner import choice\n",
"from pam.planner import choice_location as choice\n",
"from pam.operations.cropping import link_population\n",
"from pam.planner.od import OD, Labels, ODMatrix, ODFactory\n",
"import random\n",
Expand Down Expand Up @@ -235,7 +235,7 @@
{
"cell_type": "code",
"execution_count": 6,
"id": "ddafc60f",
"id": "15027351",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -326,8 +326,8 @@
"name": "stderr",
"output_type": "stream",
"text": [
"INFO:pam.planner.choice:Updated model configuration\n",
"INFO:pam.planner.choice:ChoiceConfiguration(u=None, scope=None, func_probabilities=<function calculate_mnl_probabilities at 0x7f56a3660c10>, func_sampling=<function sample_weighted at 0x7f56a3660ca0>)\n"
"INFO:pam.planner.choice_location:Updated model configuration\n",
"INFO:pam.planner.choice_location:ChoiceConfiguration(u=None, scope=None, func_probabilities=<function calculate_mnl_probabilities at 0x7f7a192acca0>, func_sampling=<function sample_weighted at 0x7f7a192acd30>)\n"
]
}
],
Expand Down Expand Up @@ -361,8 +361,8 @@
"name": "stderr",
"output_type": "stream",
"text": [
"INFO:pam.planner.choice:Updated model configuration\n",
"INFO:pam.planner.choice:ChoiceConfiguration(u=\"[0,-1]+(np.array([0,2])*(person.attributes['subpopulation']=='poor'))+([-0.05,-0.07]*od['time',person.home.area])+(0.4*np.log(zones['jobs']))\\n\", scope=\"act.act=='work'\", func_probabilities=<function calculate_mnl_probabilities at 0x7f56a3660c10>, func_sampling=<function sample_weighted at 0x7f56a3660ca0>)\n"
"INFO:pam.planner.choice_location:Updated model configuration\n",
"INFO:pam.planner.choice_location:ChoiceConfiguration(u=\"[0,-1]+(np.array([0,2])*(person.attributes['subpopulation']=='poor'))+([-0.05,-0.07]*od['time',person.home.area])+(0.4*np.log(zones['jobs']))\\n\", scope=\"act.act=='work'\", func_probabilities=<function calculate_mnl_probabilities at 0x7f7a192acca0>, func_sampling=<function sample_weighted at 0x7f7a192acd30>)\n"
]
}
],
Expand Down Expand Up @@ -402,7 +402,7 @@
"output_type": "stream",
"text": [
"Activities in scope: \n",
" [ChoiceIdx(pid='chris', hid='chris', seq=1, act=<pam.activity.Activity object at 0x7f56a3656760>), ChoiceIdx(pid='fatema', hid='fatema', seq=1, act=<pam.activity.Activity object at 0x7f56a3656e20>), ChoiceIdx(pid='fred', hid='fred', seq=3, act=<pam.activity.Activity object at 0x7f56a35e38b0>), ChoiceIdx(pid='gerry', hid='gerry', seq=3, act=<pam.activity.Activity object at 0x7f56a35e74f0>), ChoiceIdx(pid='nick', hid='nick', seq=1, act=<pam.activity.Activity object at 0x7f56a35e7280>)]\n",
" [ChoiceIdx(pid='chris', hid='chris', seq=1, act=<pam.activity.Activity object at 0x7f7a193248b0>), ChoiceIdx(pid='fatema', hid='fatema', seq=1, act=<pam.activity.Activity object at 0x7f7a19324f40>), ChoiceIdx(pid='fred', hid='fred', seq=3, act=<pam.activity.Activity object at 0x7f7a1926c8e0>), ChoiceIdx(pid='gerry', hid='gerry', seq=3, act=<pam.activity.Activity object at 0x7f7a19270520>), ChoiceIdx(pid='nick', hid='nick', seq=1, act=<pam.activity.Activity object at 0x7f7a192702b0>)]\n",
"\n",
"Alternatives: \n",
" [ChoiceLabel(destination='a', mode='car'), ChoiceLabel(destination='a', mode='bus'), ChoiceLabel(destination='b', mode='car'), ChoiceLabel(destination='b', mode='bus')]\n",
Expand Down Expand Up @@ -443,10 +443,10 @@
"name": "stderr",
"output_type": "stream",
"text": [
"INFO:pam.planner.choice:Applying choice model...\n",
"INFO:pam.planner.choice:Configuration: \n",
"ChoiceConfiguration(u=\"[0,-1]+(np.array([0,2])*(person.attributes['subpopulation']=='poor'))+([-0.05,-0.07]*od['time',person.home.area])+(0.4*np.log(zones['jobs']))\\n\", scope=\"act.act=='work'\", func_probabilities=<function calculate_mnl_probabilities at 0x7f56a3660c10>, func_sampling=<function sample_weighted at 0x7f56a3660ca0>)\n",
"INFO:pam.planner.choice:Choice model application complete.\n"
"INFO:pam.planner.choice_location:Applying choice model...\n",
"INFO:pam.planner.choice_location:Configuration: \n",
"ChoiceConfiguration(u=\"[0,-1]+(np.array([0,2])*(person.attributes['subpopulation']=='poor'))+([-0.05,-0.07]*od['time',person.home.area])+(0.4*np.log(zones['jobs']))\\n\", scope=\"act.act=='work'\", func_probabilities=<function calculate_mnl_probabilities at 0x7f7a192acca0>, func_sampling=<function sample_weighted at 0x7f7a192acd30>)\n",
"INFO:pam.planner.choice_location:Choice model application complete.\n"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion pam/planner/choice.py → pam/planner/choice_location.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Choice models for activity synthesis
Location and mode choice models for activity modelling
"""
from copy import deepcopy
from dataclasses import dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import random
from tests.test_22_planner_od import data_od, labels, od
from tests.test_23_planner_zones import data_zones
from pam.planner.choice import ChoiceModel, ChoiceMNL, ChoiceSet, \
from pam.planner.choice_location import ChoiceModel, ChoiceMNL, ChoiceSet, \
ChoiceConfiguration
from pam.planner.utils_planner import sample_weighted
import os
Expand Down

0 comments on commit 9b4600d

Please sign in to comment.