/// <summary> /// Creates a new path /// </summary> /// <param name="firstPathElement">First path element</param> /// <param name="secondPathElement">Second path element</param> public Path(PathElement firstPathElement, PathElement secondPathElement) { _pathElements = new List <PathElement> { firstPathElement, secondPathElement }; Weight = firstPathElement.Weight + secondPathElement.Weight; LastPathElement = secondPathElement; }
/// <summary> /// Creates a new path /// </summary> /// <param name="pathElement">Path element.</param> public Path(PathElement pathElement) { _pathElements = new List <PathElement> { pathElement }; Weight = pathElement.Weight; LastPathElement = pathElement; }
/// <summary> /// Initializes a new instance of the Path class. /// </summary> /// <param name='anotherPath'> /// Another path. /// </param> /// <param name='lastElement'> /// Last element. /// </param> public Path(Path anotherPath, PathElement lastElement) { _pathElements = new List <PathElement>(anotherPath._pathElements) { lastElement }; Weight = anotherPath.Weight + lastElement.Weight; LastPathElement = lastElement; }
public Boolean Equals(PathElement p) { // If parameter is null return false: if ((object)p == null) { return(false); } return(ReferenceEquals(Edge, p.Edge) && Direction == p.Direction); }
/// <summary> /// Revert this path. /// </summary> public void ReversePath() { LastPathElement = _pathElements[0]; _pathElements.Reverse(); }
/// <summary> /// Adds a path element /// </summary> /// <param name="pathElement">PathElement.</param> public void AddPathElement(PathElement pathElement) { _pathElements.Add(pathElement); Weight += pathElement.Weight; LastPathElement = pathElement; }
public Boolean Equals(PathElement p) { // If parameter is null return false: if ((object) p == null) { return false; } return ReferenceEquals(Edge, p.Edge) && Direction == p.Direction; }
/// <summary> /// Creates a new PathElementREST instance /// </summary> public PathElementREST(PathElement toBeTransferredResult) { SourceVertexId = toBeTransferredResult.SourceVertex.Id; TargetVertexId = toBeTransferredResult.TargetVertex.Id; EdgeId = toBeTransferredResult.Edge.Id; EdgePropertyId = toBeTransferredResult.EdgePropertyId; Direction = toBeTransferredResult.Direction; Weight = toBeTransferredResult.Weight; }