public BoundarySolverResult Clone() { BoundarySolverResult res = new BoundarySolverResult(); res.list = new List <RowNode>(list); res.totalCount = this.totalCount; return(res); }
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); }
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); }
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(); } }
public BoundarySolver(Metric metric, BoundarySolverResult solverResult) : base(metric, solverResult) { resultRepository = new List <BoundarySolverResult>(); }