Skip to content

Commit

Permalink
Create own print method for SecDestPurpose (#424)
Browse files Browse the repository at this point in the history
Calculating mode shares does not work for secondary destinations,
because they do not have own generated demand, so `Purpose`
print method causes divide-by-zero warning.
  • Loading branch information
Jens West committed Jan 12, 2022
1 parent 39b57ec commit 2561749
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Scripts/datatypes/purpose.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,3 +316,10 @@ def calc_prob(self, mode, impedance, orig, dests):
+ impedance[mtx_type][:, orig]
- impedance[mtx_type][dests, orig][:, numpy.newaxis])
return self.model.calc_prob(mode, dest_imp, orig, dests)

def print_data(self):
self.resultdata.print_data(
pandas.Series(
sum(self.attracted_tours.values()),
self.zone_data.zone_numbers),
"attraction.txt", self.name)

0 comments on commit 2561749

Please sign in to comment.