-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gc modern see #232
base: main
Are you sure you want to change the base?
Gc modern see #232
Conversation
# We find the home locations, based on the origin activity (home) | ||
# we use home locations for visulisation purposes | ||
# # todo. Add a warning if many home locations are not found | ||
homes = trips[trips.o_act=="home"][['ox','oy','agent', 'o_act']] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Originally I added a warning, but it would repeat for each set of agents parsed. Must be a way to only have that warning appear once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# in the case of the selected plan, the relative disutility is 0 | ||
plans = plans.groupby(['agent']).apply(get_relativeUtilityToSelected) | ||
plans['relativeDisUtilityToSelectedPerc'] = plans['relativeDisUtilityToSelected'] / plans['utility'] * -100.0 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
open to renaming these columns to something simpler, chose to keep it consistent with previous versions of the analysis for now.
| | ,' | | ,' `--'' '---' | , .-./---`-' : \ \ `--'---' | , / `--'---' | ||
`----' `----' `--`---' \ ' ; ---`-' | ||
`--` """) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this to the cli (ie in main.py) or remove please
|
||
for i, plan in enumerate(elem.xpath(".//plan")): | ||
|
||
# attribute = self.attributes.get(ident, {}).get(self.groupby_person_attribute, None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove commented out lines
for stage in plan: | ||
|
||
# we give each plan an id (to permit comparisons) | ||
innovation_hash = i |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this hash is broken? Try:
for i, plan in enumerate(...):
for j, stage in enumerate(plan):
hash = f"{i}-{j}"
But probably don't need the hash anyway. Just use i
and seq
?
'ox': float(activities[-1]['x']), | ||
'oy': float(activities[-1]['y']), | ||
# 'dx': float(x), | ||
# 'dy': float(y), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...remove comments
|
||
mode = {"egress_walk": "walk", "access_walk": "walk"}.get(mode, mode) # ignore access and egress walk | ||
modes[mode] = modes.get(mode, 0) + distance | ||
trip_distance = distance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be trip_distance += distance
.
trip_distance = distance | ||
|
||
self.see_trips_log.add(trips) | ||
summary.extend(trips) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.see_trips_log.add(trips)
is writing the data to disk and then we are also adding them all to a (massive) list called "summary" - is this really intended?
Reading on I see that there is some analysis done to summary
and this is then added to results. But it is going the get constantly run and overwritten.
Move elsewhere as discussed.
Fixing the unselected plans analysis within Elara. Now, the code generates a complete list of the five top plans tried and a dataset of agents that could have travelled by non-car modes but instead chose car.