Ejemplo n.º 1
0
        public PathsManager(string[] nodes, List<Link> nodesLinks)
        {
            if (nodes.Length == 0)
            {
                throw new Exception("The specified Nodes list  is invalid!");
            }

            if (nodesLinks.Count == 0)
            {
                throw new Exception("The specified NodesLinks list is invalid!");
            }

            this._nodes = nodes;
            this._nodesLinks = nodesLinks;
            this._posiblePaths = new List<PathResult>();
            this._currentPath = new PathResult();
        }
Ejemplo n.º 2
0
        public bool Equals(PathResult anotherPath)
        {
            if (this.Message != anotherPath.Message)
            {
                return false;
            }

            if (this.TotalWeights != anotherPath.TotalWeights)
            {
                return false;
            }

            if (this.Path.Equals(anotherPath.Path))
            {
                return false;
            }

            return true;
        }
Ejemplo n.º 3
0
        internal PathResult Clone()
        {
            var clonedPath = new PathResult();
            clonedPath.IsValidPath = this.IsValidPath;
            clonedPath.TotalWeights = this.TotalWeights;
            clonedPath.Path = (this.Path.ToArray().Clone() as string[]).ToList();

            return clonedPath;
        }