Exemplo n.º 1
0
 /// <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;
 }
Exemplo n.º 2
0
 /// <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;
 }
Exemplo n.º 3
0
 /// <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;
 }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
 /// <summary>
 /// Revert this path.
 /// </summary>
 public void ReversePath()
 {
     LastPathElement = _pathElements[0];
     _pathElements.Reverse();
 }
Exemplo n.º 6
0
 /// <summary>
 /// Adds a path element
 /// </summary>
 /// <param name="pathElement">PathElement.</param>
 public void AddPathElement(PathElement pathElement)
 {
     _pathElements.Add(pathElement);
     Weight         += pathElement.Weight;
     LastPathElement = pathElement;
 }
Exemplo n.º 7
0
        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;
        }
Exemplo n.º 8
0
 /// <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;
 }