Skip to content

Commit

Permalink
Merge pull request #24 from tnoud/writer-add-max_dur
Browse files Browse the repository at this point in the history
aded max_dur to add_activity
  • Loading branch information
rakow authored Nov 15, 2023
2 parents 917bf8a + 595e6f2 commit de029a2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion matsim/writers.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def end_plan(self):
self._write_line('</plan>')

def add_activity(self, type: str, x: float, y: float, facility_id: str = None,
start_time: int = None, end_time: int = None, attributes: dict = None):
start_time: int = None, end_time: int = None, max_dur: int = None, attributes: dict = None):
self._require_scope(self.PLAN_SCOPE)
self._write_indent()
self._write('<activity ')
Expand All @@ -162,6 +162,7 @@ def add_activity(self, type: str, x: float, y: float, facility_id: str = None,
if facility_id is not None: self._write(f'facility="{facility_id}" ')
if start_time is not None: self._write(f'start_time="{self.time(start_time)}" ')
if end_time is not None: self._write(f'end_time="{self.time(end_time)}" ')
if max_dur is not None: self._write(f'max_dur="{self.time(max_dur)}" ')
if attributes:
self._write('>\n')
self.indent += 1
Expand Down

0 comments on commit de029a2

Please sign in to comment.