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.
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.
| # 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.
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.
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.
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.
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), |
|
|
||
| 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.
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.
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.