From a2802a2da3b732c2c6d4a12bb6d245086510ce46 Mon Sep 17 00:00:00 2001 From: Mau Magnaguagno Date: Thu, 20 Jul 2023 17:33:43 -0300 Subject: [PATCH] Update Polygonoid search modules --- examples/search_angle/external.rb | 2 +- examples/search_circular/external.rb | 8 ++++---- examples/turtlebot/external.rb | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/search_angle/external.rb b/examples/search_angle/external.rb index 81229d8..28bbbc8 100644 --- a/examples/search_angle/external.rb +++ b/examples/search_angle/external.rb @@ -31,7 +31,7 @@ def visible(from, to) end def arc(from, to, arc_to) - line_to_arc(@symbol_object[from], @symbol_object[to], ANGLE, ENVIRONMENT) {|pos| + Linear.line_to_arc(@symbol_object[from], @symbol_object[to], ANGLE, ENVIRONMENT) {|pos| arc_to.replace(symbol(pos)) yield } diff --git a/examples/search_circular/external.rb b/examples/search_circular/external.rb index 507e142..7d40d72 100644 --- a/examples/search_circular/external.rb +++ b/examples/search_circular/external.rb @@ -19,7 +19,7 @@ def symbol(object) end def search_circular(agent, start, goal) - @plan = search(@symbol_object[start], @symbol_object[goal], CIRCLES)&.map! {|i| symbol(i)} + @plan = Circular.search(@symbol_object[start], @symbol_object[goal], CIRCLES)&.map! {|i| symbol(i)} end def plan_position(index) @@ -32,8 +32,8 @@ def plan_size def closest(circle, to, out_circle, in_dir, out_dir, goal) g = @symbol_object[goal] - circles_sort = CIRCLES.sort_by {|c| center_distance(c, g)} - each_bitangent(@symbol_object[circle], in_dir == CLOCK, circles_sort) {|c,l,d| + circles_sort = CIRCLES.sort_by {|c| Circular.center_distance(c, g)} + Circular.each_bitangent(@symbol_object[circle], in_dir == CLOCK, circles_sort) {|c,l,d| out_circle.replace(symbol(c)) to.replace(symbol(l.to)) out_dir.replace(d ? CLOCK : COUNTER) @@ -43,6 +43,6 @@ def closest(circle, to, out_circle, in_dir, out_dir, goal) def visible(point, circle, goal) g = @symbol_object[goal] - visible?(Line.new(@symbol_object[point], g), CIRCLES, @symbol_object[circle], g) + Circular.visible?(Line.new(@symbol_object[point], g), CIRCLES, @symbol_object[circle], g) end end \ No newline at end of file diff --git a/examples/turtlebot/external.rb b/examples/turtlebot/external.rb index d800704..4838e47 100644 --- a/examples/turtlebot/external.rb +++ b/examples/turtlebot/external.rb @@ -71,8 +71,8 @@ def symbol(object) def closest(circle, to, out_circle, in_dir, out_dir, goal) g = @symbol_object[goal] - circles_sort = CIRCLES.sort_by {|c| center_distance(c, g)} - each_bitangent(@symbol_object[circle], in_dir == CLOCK, circles_sort) {|c,l,d| + circles_sort = CIRCLES.sort_by {|c| Circular.center_distance(c, g)} + Circular.each_bitangent(@symbol_object[circle], in_dir == CLOCK, circles_sort) {|c,l,d| out_circle.replace(symbol(c)) to.replace(symbol(l.to)) out_dir.replace(d ? CLOCK : COUNTER) @@ -82,7 +82,7 @@ def closest(circle, to, out_circle, in_dir, out_dir, goal) def visible(point, circle, goal) g = @symbol_object[goal] - visible?(Line.new(@symbol_object[point], g), CIRCLES, @symbol_object[circle], g) + Circular.visible?(Line.new(@symbol_object[point], g), CIRCLES, @symbol_object[circle], g) end def position(x, y)