/// <summary> /// Validates that the specified cell has the correct transitions /// </summary> /// <param name="c"></param> /// <remarks></remarks> private void VALIDATE_CELL_TRANSITIONS(Cell c, int iteration, int timestep) { TransitionCollection trlist = this.GetTransitionCollection(c, iteration, timestep); if (trlist == null) { Debug.Assert(c.Transitions.Count == 0); } else { Debug.Assert(trlist.Count > 0); int tcount = 0; foreach (Transition tr in trlist) { if ((tr.SecondaryStratumId != null) && (c.SecondaryStratumId != tr.SecondaryStratumId)) { continue; } if ((tr.TertiaryStratumId != null) && (c.TertiaryStratumId != tr.TertiaryStratumId)) { continue; } if (c.Age < tr.AgeMinimum) { continue; } if (c.Age > tr.AgeMaximum) { continue; } if (!this.CompareTstValues(c, tr)) { continue; } Debug.Assert(c.Transitions.Contains(tr)); tcount += 1; } Debug.Assert(tcount == c.Transitions.Count); foreach (Transition tr in c.Transitions) { Debug.Assert(trlist.Contains(tr)); } } }