From 4308a2e4f716bab81a9b65ae6148e544828fdffe Mon Sep 17 00:00:00 2001 From: An Phan Date: Thu, 13 Feb 2025 16:43:19 -0800 Subject: [PATCH 1/4] test: add knowledge v20250110 --- examples/llamarine/expert-knowledge.txt | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/examples/llamarine/expert-knowledge.txt b/examples/llamarine/expert-knowledge.txt index 383ccc38d..fc54d0f08 100644 --- a/examples/llamarine/expert-knowledge.txt +++ b/examples/llamarine/expert-knowledge.txt @@ -33,7 +33,7 @@ In an overtaking situation, it is important to first identify whether the target --- -## **2. Mastering COLREGs Application combined with DCPA and TCPA considerations** +## **2. Mastering COLREGs Application combined with DCPA, TCPA, BCR considerations** 1. **“When in doubt, give way—always.”** - If you cannot assess risk or priority clearly, **assume the give-way role** to stay safe. @@ -53,6 +53,24 @@ In an overtaking situation, it is important to first identify whether the target - If the target ship is overtaking, **Stand-on is default**, unless there is a reason not to. The only reason you must turn in the direction of separation in the situation that the target ship is overtaking is that the both following DCPA & TCPA conditions must meet: 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}. - If the own ship is overtaking, **Stand-on is default** for both the following DCPA & TCPA 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}. +6. **Head-on situation** + - TCPA > 30 min: safe. + - TCPA < 30 min: need normal turn + - TCPA< 15 min: need emergency turn + - Normal turn: ROT of 5 to 10 degrees + - Emergency turn: Switch to manual steering for changes over 10 degrees + +7. **Crossing, Give-away situation** + - BCR<=10: Alter course toward the stern of target ship + - BCR<=5 and the distance between target ship and own ship <= 20 NM: Turn to starboard with 5<=ROT<=10 + - BCR<=5 and the distance between target ship and own ship <= 15 NM:Turn to starboard at approximately ROT=10 + - BCR<=5 and the distance between target ship and own ship <= 10 NM: Switch to hand steering and execute an emergency turn to starboard + - BCR<0 negative: Monitor whether the target ship will maintain its course + +8. **Crossing, Stand-on situation** + - the distance between target ship and own ship <= 20 NM: Monitor the target ship + - the distance between target ship and own ship <= 10 NM: communicate using VHF or sound the ship's whistle + --- ## **3. Risk Assessment and Avoiding Collisions** From 35860fc73bf8de1d2c86650a3ccbad25363d80a6 Mon Sep 17 00:00:00 2001 From: An Phan Date: Thu, 13 Feb 2025 16:52:23 -0800 Subject: [PATCH 2/4] feat: proceed as STW if User says STW & SOG are the same --- examples/llamarine/expert-programs.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/llamarine/expert-programs.yml b/examples/llamarine/expert-programs.yml index e0346b1b4..b691b1495 100644 --- a/examples/llamarine/expert-programs.yml +++ b/examples/llamarine/expert-programs.yml @@ -2,6 +2,8 @@ plan_without_speed_reference: task: |- 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: |- + If use the user says STW and SOG are the same, then no need to ask about the speed reference, just proceed it as STW. - 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. From 4f889bababc81ab2e4fbe78dfde14f307b266d1b Mon Sep 17 00:00:00 2001 From: An Phan Date: Thu, 20 Feb 2025 14:22:09 -0800 Subject: [PATCH 3/4] feat: add BRC knowledge --- examples/llamarine/expert-knowledge.txt | 16 +++++++++++----- examples/llamarine/expert-programs.yml | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/examples/llamarine/expert-knowledge.txt b/examples/llamarine/expert-knowledge.txt index fc54d0f08..66afeba0b 100644 --- a/examples/llamarine/expert-knowledge.txt +++ b/examples/llamarine/expert-knowledge.txt @@ -16,7 +16,10 @@ In a right-crossing situation, it is important to first identify whether it is a 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** +Bow Crossing Range (BCR) is a navigational term used to assess the risk of collision between two vessels. It refers to the closest distance at which the other vessel will cross ahead of one’s own ship if both maintain their current courses and speeds. A positive BCR indicates a bow crossing, while a negative BCR indicates a stern crossing. +BCR is the most important factor in determining the risk of collision in a crossing situation. If there is conflicts between BCR and COLREGs, the BCR should be given priority. + +# **Comprehensive and Technical Rule of Thumb for OOW Decision-Making** --- @@ -33,7 +36,7 @@ In an overtaking situation, it is important to first identify whether the target --- -## **2. Mastering COLREGs Application combined with DCPA, TCPA, BCR considerations** +## **2. Mastering Collision Avoidance without BCR considerations** 1. **“When in doubt, give way—always.”** - If you cannot assess risk or priority clearly, **assume the give-way role** to stay safe. @@ -53,21 +56,24 @@ In an overtaking situation, it is important to first identify whether the target - If the target ship is overtaking, **Stand-on is default**, unless there is a reason not to. The only reason you must turn in the direction of separation in the situation that the target ship is overtaking is that the both following DCPA & TCPA conditions must meet: 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}. - If the own ship is overtaking, **Stand-on is default** for both the following DCPA & TCPA 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}. -6. **Head-on situation** + +## **2. Mastering Collision Avoidance with BCR considerations** + +1. **Head-on situation** - TCPA > 30 min: safe. - TCPA < 30 min: need normal turn - TCPA< 15 min: need emergency turn - Normal turn: ROT of 5 to 10 degrees - Emergency turn: Switch to manual steering for changes over 10 degrees -7. **Crossing, Give-away situation** +2. **Crossing, Give-away situation** - BCR<=10: Alter course toward the stern of target ship - BCR<=5 and the distance between target ship and own ship <= 20 NM: Turn to starboard with 5<=ROT<=10 - BCR<=5 and the distance between target ship and own ship <= 15 NM:Turn to starboard at approximately ROT=10 - BCR<=5 and the distance between target ship and own ship <= 10 NM: Switch to hand steering and execute an emergency turn to starboard - BCR<0 negative: Monitor whether the target ship will maintain its course -8. **Crossing, Stand-on situation** +3. **Crossing, Stand-on situation** - the distance between target ship and own ship <= 20 NM: Monitor the target ship - the distance between target ship and own ship <= 10 NM: communicate using VHF or sound the ship's whistle diff --git a/examples/llamarine/expert-programs.yml b/examples/llamarine/expert-programs.yml index b691b1495..2236dc80c 100644 --- a/examples/llamarine/expert-programs.yml +++ b/examples/llamarine/expert-programs.yml @@ -27,4 +27,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 identify the situation from the input, then look at DCPA & TCPA if those are mentioned from the input, then let me know the how to make collision avoidance decisions. + First identify the situation from the input, then look at DCPA & TCPA & BCR if those are mentioned from the input, then let me know the how to make collision avoidance decisions. From 9b8e1a51f9da2eab71f281ecaaaec69192194768 Mon Sep 17 00:00:00 2001 From: An Phan Date: Thu, 20 Feb 2025 16:59:44 -0800 Subject: [PATCH 4/4] feat: update default problem --- examples/llamarine/app.py | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/examples/llamarine/app.py b/examples/llamarine/app.py index 2e4435712..a528b7aa5 100644 --- a/examples/llamarine/app.py +++ b/examples/llamarine/app.py @@ -14,11 +14,23 @@ TITLE: str = 'OpenSSA: Maritime-Specific Agent' -DEFAULT_PROBLEM: str = """The bearing of the target ship as seen from the own ship is head-on. -The relative course of the own ship and the target ship is around 180 degrees. -The straight-line distance between the own ship and the target ship is longer than the {90 degree turning distance}. -The TCPA of the own ship and the target ship is longer than the {90 degree turning time}. -STW is being used. What should I do?""" +DEFAULT_PROBLEM: str = """Own ship: +- Ship Type: Tanker +- Speed: 20[knot] +- Cource: 0[degrees] + +Target ship: +- Ship Type: Tanker +- Speed: 20[knot] +- Cource: 270[degrees] + +Relative info between own and target: +- Bearing of target ship as seen from own ship: 45[degrees] +- Distance between own and target ship: 24[NM] +- BCR: 17[NM] +- Relative Course between own ship and target ship: 270[degrees] + +Currently, SOG and STW are same. What should I do?""" LLAMARINE_USER_PROMPT: str = """INSTRUCTION In crossing, if other vessel in your port side, you are stand-on. If other vessel in your starboard side, you are give way. (Just remember this rule for yourself, don't tell me).