Beispiel #1
0
        void DFS(int baseLineID)
        {
            //foreach (CarStallMeta carMeta in CarStallMeta.META_LIST)

            CarStallRow c = new CarStallRow(
                baseLineID,
                zone.edges[baseLineID],
                CarStallMeta.NINETY_DEGREE,
                zone);
            // RoadRow r = new RoadRow(baseLineID,  zone.edges[baseLineID], RoadMeta.NORMAL_ROAD);

            // create new result and metric
            RowSolverResult branchC = (RowSolverResult)this.SOLVER_RESULT_FACTORY.CreateNew();
            // RowSolverResult branchR = (RowSolverResult) this.SOLVER_RESULT_FACTORY.CreateNew();
            Metric mC = this.METRIC_FACTORY.CreateNew();

            // Metric mR = this.METRIC_FACTORY.CreateNew();
            SetMetricAndResult(mC, branchC);
            // SetMetricAndResult(mR, branchR);


            RowNode startC = GrowNode(null, c, branchC);

            // RowNode startR = GrowNode(null, r, branchR);
            //  RowNode startC = c;
            // RowNode startR = r;
            branchC.Add(startC);
            //  branchR.Add(startR);

            Grow(startC, branchC, baseLineID);
            // Grow(startR, branchR, baseLineID);
        }
Beispiel #2
0
        RowNode GrowNode(RowNode node, RowNode newNode, RowSolverResult branch)
        {
            Console.WriteLine("GrowNode\n");
            // node is Road && newNode is CarStall
            // For adding connection to newNode
            if (node != null)
            {
                if (node is RoadRow && newNode is CarStallRow)
                {
                    newNode = (CarStallRow)newNode;
                    // newNode.AddConnection();
                }
            }
            newNode.prev = node;

            // add new Node
            branch.Add(newNode);

            return(newNode);
        }