Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/virtualship/expedition/simulate_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ def simulate(self) -> ScheduleOk | ScheduleProblem:
f"Waypoint {wp_i} could not be reached in time. Current time: {self._time}. Waypoint time: {waypoint.time}."
)
return ScheduleProblem(self._time, wp_i)
else:
self._time = (
waypoint.time
) # wait at the waypoint until ship is schedules to be there

# note measurements made at waypoint
time_passed = self._make_measurements(waypoint)
Expand All @@ -122,7 +126,7 @@ def _progress_time_traveling_towards(self, location: Location) -> None:
lons2=location.lon,
lats2=location.lat,
)
ship_speed_meter_per_second = self._ship_config.ship_speed_knots * 3600 / 1852
ship_speed_meter_per_second = self._ship_config.ship_speed_knots * 1852 / 3600
azimuth1 = geodinv[0]
distance_to_next_waypoint = geodinv[2]
time_to_reach = timedelta(
Expand Down