public class OSQLFunctionAstar extends OSQLFunctionHeuristicPathFinderAbstract
The first parameter is source record. The second parameter is destination record. The third parameter is a name of property that represents 'weight' and fourth represnts the map of options.
If property is not defined in edge or is null, distance between vertexes are 0 .
Modifier and Type | Field and Description |
---|---|
protected Map<OVertex,OVertex> |
cameFrom |
protected Set<OVertex> |
closedSet |
protected Map<OVertex,Double> |
fScore |
protected Map<OVertex,Double> |
gScore |
static String |
NAME |
protected PriorityQueue<OVertex> |
open |
context, MIN, PARAM_CUSTOM_HEURISTIC_FORMULA, PARAM_D_FACTOR, PARAM_DIRECTION, PARAM_EDGE_TYPE_NAMES, PARAM_EMPTY_IF_MAX_DEPTH, PARAM_HEURISTIC_FORMULA, PARAM_MAX_DEPTH, PARAM_PARALLEL, PARAM_TIE_BREAKER, PARAM_VERTEX_AXIS_NAMES, paramCustomHeuristicFormula, paramDestinationVertex, paramDFactor, paramDirection, paramEdgeTypeNames, paramEmptyIfMaxDepth, paramHeuristicFormula, paramMaxDepth, paramParallel, paramSourceVertex, paramTieBreaker, paramVertexAxisNames, rnd, route
configuredParameters
maxParams, minParams, name
Constructor and Description |
---|
OSQLFunctionAstar() |
Modifier and Type | Method and Description |
---|---|
boolean |
aggregateResults()
A function can make calculation on several records before returning a result.
|
LinkedList<OVertex> |
execute(Object iThis,
OIdentifiable iCurrentRecord,
Object iCurrentResult,
Object[] iParams,
OCommandContext iContext)
Process a record.
|
protected double |
getDistance(OEdge edge) |
protected double |
getDistance(OVertex node,
OVertex parent,
OVertex target) |
protected double |
getHeuristicCost(OVertex node,
OVertex parent,
OVertex target,
OCommandContext iContext) |
protected Set<OEdge> |
getNeighborEdges(OVertex node) |
Object |
getResult()
Only called when function aggregates results after all records have been passed to the
function.
|
String |
getSyntax()
Returns a convenient SQL String representation of the function.
|
protected boolean |
isVariableEdgeWeight() |
booleanOrDefault, doubleOrDefault, getCustomHeuristicCost, getDiagonalHeuristicCost, getDiagonalHeuristicCost, getEuclideanHeuristicCost, getEuclideanHeuristicCost, getEuclideanNoSQRHeuristicCost, getEuclideanNoSQRHeuristicCost, getManhatanHeuristicCost, getManhatanHeuristicCost, getMaxAxisHeuristicCost, getMaxAxisHeuristicCost, getNeighbors, getPath, getSimpleHeuristicCost, getTieBreakingHeuristicCost, getTieBreakingHeuristicCost, getTieBreakingRandomHeuristicCost, integerOrDefault, longOrDefault, stringArray, stringOrDefault
getClassWithMorePrecision, getContextValue, shouldMergeDistributedResult
config, toString
filterResult, getDistributedStorageId, getMaxParams, getMinParams, getName, getSingleItem, getSingleProperty, mergeDistributedResult, returnDistributedResult, setResult
public static final String NAME
protected PriorityQueue<OVertex> open
public LinkedList<OVertex> execute(Object iThis, OIdentifiable iCurrentRecord, Object iCurrentResult, Object[] iParams, OCommandContext iContext)
OSQLFunction
iCurrentRecord
- : current recordiCurrentResult
- TODOiParams
- : function parameters, number is ensured to be within minParams and maxParams.iContext
- : object calling this functionpublic String getSyntax()
OSQLFunction
Example :
myFunction( param1, param2, [optionalParam3])
This text will be used in exception messages.
public Object getResult()
OSQLFunction
getResult
in interface OSQLFunction
getResult
in class OSQLFunctionAbstract
protected double getDistance(OVertex node, OVertex parent, OVertex target)
getDistance
in class OSQLFunctionHeuristicPathFinderAbstract
protected double getDistance(OEdge edge)
public boolean aggregateResults()
OSQLFunction
Example of such function : sum, count, max, min ...
The final result of the aggregation is obtain by calling OSQLFunction.getResult()
aggregateResults
in interface OSQLFunction
aggregateResults
in class OSQLFunctionMathAbstract
protected double getHeuristicCost(OVertex node, OVertex parent, OVertex target, OCommandContext iContext)
getHeuristicCost
in class OSQLFunctionHeuristicPathFinderAbstract
protected boolean isVariableEdgeWeight()
isVariableEdgeWeight
in class OSQLFunctionHeuristicPathFinderAbstract
Copyright © 2009–2020 OrientDB. All rights reserved.