Private
Public Access
1
0

routine to find shortest course completion

If rowing through start box more than 1 time, it checks for every
passing of the start box
This commit is contained in:
Sander Roosendaal
2018-06-01 09:16:24 +02:00
parent 45c406b621
commit 3998c7dded
3 changed files with 60 additions and 18 deletions

View File

@@ -10,7 +10,7 @@ class InvalidTrajectoryError(Exception):
def __str__(self):
return repr(self.value)
def time_in_path(df,p,maxmin='max'):
def time_in_path(df,p,maxmin='max',getall=False):
if df.empty:
return 0
@@ -29,7 +29,10 @@ def time_in_path(df,p,maxmin='max'):
if len(df[b==2]):
return df[b==2]['time'].min(),df[b==2]['cum_dist'].min()
if getall:
return df[b==2]['time'],df[b==2]['cum_dist']
else:
return df[b==2]['time'].min(),df[b==2]['cum_dist'].min()
raise InvalidTrajectoryError("Trajectory doesn't go through path")