Record Class AStarUtil.PathResult<V>
java.lang.Object
java.lang.Record
cloud.opencode.base.graph.algorithm.AStarUtil.PathResult<V>
- Type Parameters:
V- the vertex type | 顶点类型- Record Components:
path- the path vertices | 路径顶点cost- the total path cost | 总路径成本nodesExpanded- number of nodes expanded during search | 搜索期间展开的节点数
- Enclosing class:
AStarUtil
public static record AStarUtil.PathResult<V>(List<V> path, double cost, int nodesExpanded)
extends Record
Result of A* search including path and cost
A*搜索结果,包含路径和成本
- Since:
- JDK 25, opencode-base-graph V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Constructor Summary
ConstructorsConstructorDescriptionPathResult(List<V> path, double cost, int nodesExpanded) Creates an instance of aPathResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoublecost()Returns the value of thecostrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanhasPath()intReturns the value of thenodesExpandedrecord component.path()Returns the value of thepathrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PathResult
Creates an instance of aPathResultrecord class.- Parameters:
path- the value for thepathrecord componentcost- the value for thecostrecord componentnodesExpanded- the value for thenodesExpandedrecord component
-
-
Method Details
-
hasPath
public boolean hasPath() -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
path
-
cost
-
nodesExpanded
public int nodesExpanded()Returns the value of thenodesExpandedrecord component.- Returns:
- the value of the
nodesExpandedrecord component
-