Exemple #1
0
        public BoundarySolverResult Clone()
        {
            BoundarySolverResult res = new BoundarySolverResult();

            res.list       = new List <RowNode>(list);
            res.totalCount = this.totalCount;
            return(res);
        }
Exemple #2
0
        public BoundarySolverResult GetBest(int n)
        {
            if (n >= resultRepository.Count())
            {
                return(null);
            }


            // double max = resultRepository.ElementAt(i).CalculateTotalStall();
            // MessageBox.Show(resultRepository.Count().ToString());
            BoundarySolverResult res = resultRepository[n];

            //writeLog(res.endNode);
            return(res);
        }
Exemple #3
0
        public new List <BoundarySolverResult> Solve()
        {
            BoundarySolverResult branch = new BoundarySolverResult();

            Grow(branch, 0);

            foreach (BoundarySolverResult cur in resultRepository)
            {
                int curValue = cur.CalculateTotalStall();
            }
            // double max = resultRepository.ElementAt(i).CalculateTotalStall();
            // MessageBox.Show(resultRepository.Count().ToString());
            resultRepository.Sort((a, b) => (b.totalCount - a.totalCount));

            return(this.resultRepository);
        }
Exemple #4
0
        void Grow(BoundarySolverResult branch, int baseLineID)
        {
            if (baseLineID >= this.zone.edges.Length)
            {
                // Change branch
                branch.ChangeToInnerLine();
                resultRepository.Add(branch);


                return;
            }

            foreach (CarStallMeta meta in CarStallMeta.SINGLE_META_LIST)
            {
                RowNode newNode = new CarStallRow(
                    baseLineID,
                    zone.OffsetInZone(zone.edges[baseLineID], baseLineID, 0),
                    meta,
                    zone);
                branch.Add(newNode);
                Grow(branch.Clone(), baseLineID + 1);
                branch.RemoveLast();
            }
        }
Exemple #5
0
 public BoundarySolver(Metric metric, BoundarySolverResult solverResult) : base(metric, solverResult)
 {
     resultRepository = new List <BoundarySolverResult>();
 }