Skip to content

Commit

Permalink
Update Polygonoid search modules
Browse files Browse the repository at this point in the history
  • Loading branch information
Maumagnaguagno committed Jul 20, 2023
1 parent 8644976 commit a2802a2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion examples/search_angle/external.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
8 changes: 4 additions & 4 deletions examples/search_circular/external.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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
6 changes: 3 additions & 3 deletions examples/turtlebot/external.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit a2802a2

Please sign in to comment.