Utils

This folder contains all the auxiliary functions needed.

Functions

Dionysos.Utils.path_costFunction

Return the cost of a solution path that arrives at state2 from state1 via action, assuming cost c to get up to state1. If the problem is such that the path doesn't matter, this function will only look at state2. If the path does matter, it will consider c and maybe state1 and action. The default method costs 1 for every step in the path.

source
Dionysos.Utils.best_first_graph_searchFunction

Search the nodes with the lowest f scores first. You specify the function f(node) that you want to minimize; for example, if f is a heuristic estimate to the goal, then we have greedy best first search; if f is node.depth then we have depth-first search.

source
Dionysos.Utils.AbstractQueueType

AbstractQueue is an abstract type. There are three types: MyStack(): A Last In First Out Queue. FIFOQueue(): A First In First Out Queue. MyPriorityQueue(f,ext): Queue where items are sorted by f, (default <). Each type supports the following methods and functions: append!(q,item) – add an item to the queue extend!(q,items) – equivalent to: for item in items: append(q,item) pop!(q) – return the top item from the queue length(q) – number of items in q

source
Dionysos.Utils.tree_searchFunction

Search through the successors of a problem to find a goal. The argument fringe should be an empty queue. Don't worry about repeated paths to a state.

source
Dionysos.Utils.goal_testFunction

Return True if the state is a goal. The default method compares the state to P.goal, as specified in the constructor. Implement this method if checking against a single goal is not enough.

source
Dionysos.Utils.graph_searchFunction

Search through the successors of a problem to find a goal. The argument fringe should be an empty queue. If two paths reach a state, only use the best one.

source
Dionysos.Utils.best_first_tree_searchFunction

Search the nodes with the lowest f scores first. You specify the function f(node) that you want to minimize; for example, if f is a heuristic estimate to the goal, then we have greedy best first search; if f is node.depth then we have depth-first search.

source
Dionysos.Utils.successorFunction

Given a state, return a sequence of (action, state) pairs reachable from this state. If there are many successors, consider an iterator that yields the successors one at a time, rather than building them all at once.

source
Dionysos.Utils.NodeType

A node in a search tree. Contains a pointer to the parent (the node that this is a successor of) and to the actual state for this node. Note that if a state is arrived at by two paths, then there are two nodes with the same state. Also includes the action that got us to this state, and the total pathcost (also known as g) to reach the node. Other functions may add an f and h value; see bestfirstgraphsearch and astar_search for an explanation of how the f and h values are handled.

source
Dionysos.Utils.SearchProblemType
SearchProblem

Fields

- `initial`  -- initial state of type `S` or a list of initial state of type `S`.
- `goal`     -- possibly a goal state of type 'Union{Nothing,S}''.

Example

struct Problem{S} <: SearchProblem{S}
    initial::Union{S,Vector{S}}
    goal::Union{Nothing,S}
end
The constructor specifies the initial state, and possibly a goal
state, if there is a unique goal.
function Problem(initial::S; goal=nothing) where S
    return Problem{S}(initial,goal)
end
source
Dionysos.Utils.RRTFunction
Basic generic RRT algorihtm
SI : initial state (this will be the root of the tree) ;
SF : target state that we try to reach ;
distance : function that defines a metric between the states ;
rand_state : function that returns a random candidate state ;
new_conf : function that returns a reachable state, with the action and the cost ;
keep : function to filter the node that we want to add during an iteration;
stop_crit : stop criteria ;
RRTstar : boolean to use RRT* ;
compute_transition : to compute transition between to given state (if RRTstar is true).
source
Dionysos.Utils.TreeType

Tree structure with

  • cost for transitions (the cost function a non-negative function);
  • an underlying metric between the states that are encapsulated in the nodes of the tree
source