Skip to content

Commit

Permalink
Merge pull request #387 from aitomatic/test_v20241114
Browse files Browse the repository at this point in the history
Add knowledge related to DCPA & TCPA for head-on, crossing, overtaking scenarios
  • Loading branch information
TheVinhLuong102 authored Nov 15, 2024
2 parents ae9ce32 + 8b2adff commit 4df0b1a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 12 deletions.
2 changes: 1 addition & 1 deletion examples/llamarine/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def main(use_domain_lm: bool = False):
if (solution := st.session_state.agent_solutions[st.session_state.typed_problem]):
if use_domain_lm:
solution = OpenAILM.from_defaults().get_response(
prompt=f"""Please respond the following text:
prompt=f"""Please respond the following text, with making sure there is a conclusion which is the main action item at the end of the response.
{solution}
""",
history=[
Expand Down
27 changes: 20 additions & 7 deletions examples/llamarine/expert-knowledge.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
SOG based on the Earth as the reference, might lead to misleading on radar such as display head on situation on the water
as crossing situation.
STW based on water might avoid this ambiguty.
DCPA is distance of closest point of approach.
TCPA is time at closest point of approach.
DCPA & TCPA are not in COLREGS, but they are useful for OOW decision-making.

SOG based on the Earth as the reference, might lead to misleading on radar such as display head on situation on the water as crossing situation.
STW based on water might avoid this ambiguity.

Be careful with the risk misleading on radar such as display head on situation on the water as crossing situation.
COLREGS was designed to all vessel, even without radar.

Not all head-on situations require a starboard turn.
Not all right-crossing situations require a starboard turn.
Some left-crossing situations require taking actions, while most do not.

In an overtaking situation, it is important to first identify whether the target ship or the own ship is overtaking.

# **Comprehensive and Technical Rule of Thumb for OOW Decision-Making with Focus on COLREGs**

---
Expand All @@ -22,7 +31,7 @@ COLREGS was designed to all vessel, even without radar.

---

## **2. Mastering COLREGs Application**
## **2. Mastering COLREGs Application with DCPA and/or TCPA consideration**
1. **“When in doubt, give way—always.”**
- If you cannot assess risk or priority clearly, **assume the give-way role** to stay safe.

Expand All @@ -31,12 +40,16 @@ COLREGS was designed to all vessel, even without radar.

3. **"Stand-on means stay alert.”**
- Even as the stand-on vessel, **be ready to act** if the give-way vessel fails to maneuver. Monitor closely (Rule 17).
- If the give-way vessel is not taking an evasive action, make a starboard turn or slow down.

4. **"Always turn to starboard unless there’s a reason not to.”**
- Meeting head-on? **Starboard turn is default** (Rule 14). Avoid left-turning unless absolutely necessary.
- Meeting a head-on? **Starboard turn is default** (Rule 14). Avoid left-turning unless absolutely necessary. In a head-on situation, especially when both the DCPA and the TCPA are shorter than the {90 degree turning distance}, we must not only make a starboard turn but also do it quickly and drastically. In a head-on situation, the only reason not to turn to starboard is when both the DCPA and the TCPA are longer than the {90 degree turning distance}, then we should keep course and speed.
- Meeting a right-crossing? **Starboard turn is default** (Rule 15). In a right-crossing situation which is also a stern-crossing situation, the only reason not to turn to starboard is when the DCPA is longer than the {rear safety distance}, then we should keep course and speed. In a right-crossing situation which is also a bow-crossing situation, especially when the DCPA is shorter than {right-crossing safety distance} and the TCPA is shorter than {right-crossing safety time}, we must make a starboard turn quickly and drastically. In a right-crossing situation which is also a bow-crossing situation, the only reason not to turn to starboard is when the DCPA is longer than {right-crossing safety distance} (even when it is shorter than the {rear safety distance}) and the TCPA is longer than {right-crossing safety time}, then we should keep course and speed.
- Meeting a left-crossing? **Stand-on is default**.

5. **"You’re overtaking? You must stay clear."**
- If approaching a vessel from more than 22.5° abaft the beam (Rule 13), **you are overtaking**—stay clear until the maneuver is complete.
5. **"Meeting an overtaking? You must stay clear."**
- If the target ship is overtaking, **Stand-on is default**, unless the following conditions: the DCPA of the own ship and the target ship is shorter than the {safe distance to be overtaken}, and the TCPA of the own ship and the target ship is shorter than the {safe time to be overtaken}, then you must turn in the direction of separation.
- If the own ship is overtaking, **Stand-on is default** for the following conditions: The DCPA of the own ship and the target ship is longer than the {safe distance to overtake}, and the TCPA of the own ship and the target ship is longer than the {safe time to overtake}.

---

Expand Down
8 changes: 4 additions & 4 deletions examples/llamarine/expert-programs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plan_without_speed_reference:
task: |-
Recommend the user ask about a vessel on boat side coming to a crossing situation in radar without specifying SOG or STW are being used.
Recommend the user ask about a vessel on boat side coming to a crossing situation (and only crossing situation) in radar without specifying SOG or STW are being used.
sub-htps:
- task: |-
Reject to answer due to lack of information or ambiguity in the user input. Request to know if SOG or STW is being used.
Expand All @@ -13,9 +13,9 @@ plan_with_speed_reference_sog:
- task: |-
Please visually check the windows, not entirely relying on the radar. It's possible that this is a head on situation.
- task: |-
If you sure this is a crossing situation, first tell me all the related rules in COLREGs, then let me know the how to apply them in the crossing situation.
If you're sure this is a crossing situation, first tell me all the related rules in COLREGs, then let me know the how to apply them in the crossing situation, with considering DCPA and/or TCPA.
- task: |-
If you sure this is a head on situation, first tell me all the related rules in COLREGs, then let me know the how to apply them in the head on situation.
If you're sure this is a head on situation, first tell me all the related rules in COLREGs, then let me know the how to apply them in the head on situation, with considering DCPA and TCPA.
- task: |-
Compose to the final answer contains all above outputs and show recommended actions for both crossing and head on situations.
Expand All @@ -25,4 +25,4 @@ plan_with_speed_reference_stw:
Recommend the user what to do based on the identified situation on radar. Only apply this if specifying STW is being used.
sub-htps:
- task: |-
First tell me all the related rules in COLREGs, then interpret situation from input and let me know the how to apply them in this situation.
First tell me all the related rules in COLREGs, then interpret situation from input and let me know the how to apply them in this situation, with considering DCPA and TCPA.

0 comments on commit 4df0b1a

Please sign in to comment.