/// <summary> /// Reorders the list of shufflable transition groups /// </summary> /// <param name="iteration"></param> /// <param name="timestep"></param> /// <param name="groups"></param> /// <remarks></remarks> private void ReorderShufflableTransitionGroups(int iteration, int timestep) { TransitionOrderCollection orders = this.m_TransitionOrderMap.GetTransitionOrders(iteration, timestep); if (orders == null) { ShuffleUtilities.ShuffleList(this.m_ShufflableTransitionGroups, this.m_RandomGenerator.Random); } else { this.ReorderShufflableTransitionGroups(orders); } #if DEBUG this.VALIDATE_SHUFFLABLE_GROUPS(); #endif }
/// <summary> /// Resets the transition spread group cells /// </summary> /// <remarks></remarks> private void ResetTransitionSpreadGroupCells() { ShuffleUtilities.ShuffleList(this.m_TransitionSpreadGroups, this.m_RandomGenerator.Random); foreach (TransitionGroup t in this.m_TransitionSpreadGroups) { t.TransitionSpreadCells.Clear(); } foreach (Cell c in this.m_Cells) { foreach (TransitionGroup t in this.m_TransitionSpreadGroups) { if (t.TransitionSpreadDistributionMap.HasDistributionRecords(c.StratumId, c.StateClassId)) { t.TransitionSpreadCells.Add(c.CellId, c); } } } }
/// <summary> /// Shuffles the order of the specified stratum's cells /// </summary> /// <param name="stratum"></param> /// <remarks></remarks> private void ShuffleStratumCells(Stratum stratum) { if (stratum.Cells.Count == 0) { return; } List <Cell> lst = new List <Cell>(); foreach (Cell c in stratum.Cells.Values) { lst.Add(c); } ShuffleUtilities.ShuffleList(lst, this.m_RandomGenerator.Random); stratum.Cells.Clear(); foreach (Cell c in lst) { stratum.Cells.Add(c.CellId, c); } }