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:
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user