HGraph Solver

This module an meta-class for HGraph Solvers.
To make specific HGraph solvers it is required to create to from a concrete solver by using the function discopygal.solver.hgraphs.MetaHGraphSolver.make_hgraph_solver_class()
This will create a new solver class of HGraph solver based on given solver class
class discopygal.solvers.hgraphs.HGraph(solver_class, num_paths, neighborhood_distance, **kwargs)

Bases: SamplingSolver

A generic HGraph Solver. Receives a solver class which is the specific solver that is used to construct each path and for the local connector.

Parameters:
  • solver_class (Solver) – The specific solver class to use for the HGraph algorithm (to construct the paths and for the local connector).

  • num_paths – The number of solutions (paths) to construct

  • neighborhood_distance (FT) – The radius of the local neighborhood to seek and connect optional bridges.

build_roadmap()

Constructs the roadmap of points in the configuration space which a path will be searched on to find a solution. Every sampling solver should implement how to build the roadmap.

Returns:

The built roadmap. Each node represents a point in configuration space (dimension = 2*robots_num)

Return type:

Roadmap

classmethod get_arguments()

Return a list of arguments and their description, defaults and types. Can be used by a GUI to generate fields dynamically. Should be overridded by solvers.

Returns:

arguments dict

Return type:

dict

get_potential_bridges(path1, path2)

Return all pairs of points between two paths that are close enough to connect a bridge between them.

Parameters:
local_connector(v1, v2, roadmap)

Use solver_class to locally connect to points v1 and v2, on roadmap

Parameters:
  • v1 (Point_d) – First point

  • v2 (nx.Graph) – Second point

  • roadmap – The roadmap to add the edges of the local path

class discopygal.solvers.hgraphs.HGraph_PRM(**kwargs)

Bases: MetaHGraphSolver

solver_class

alias of PRM

class discopygal.solvers.hgraphs.HGraph_RRT(**kwargs)

Bases: MetaHGraphSolver

solver_class

alias of RRT

class discopygal.solvers.hgraphs.MetaHGraphSolver(**kwargs)

Bases: HGraph

A meta class to create specific HGraph solvers (HGraph solver based on specific solver class)

classmethod get_arguments()

Return a list of arguments and their description, defaults and types. Can be used by a GUI to generate fields dynamically. Should be overridded by solvers.

Returns:

arguments dict

Return type:

dict

static make_hgraph_solver_class(solver_class)
Create a specific HGraph solver class from given solver_class.
Name of the class will be: HGraph_<solver_class_name>
Parameters:

solver_class – The solver class to make a HGraph solver based on it

Returns:

The new created solver class

Return type:

HGraph

Currently specific HGraph solvers

  1. HGraph for PRM: discopygal.solvers.hgraphs.HGraph_PRM

  2. HGraph for RRT: discopygal.solvers.hgraphs.HGraph_RRT