public void ExportRefinement(Obstacle parent, ObstacleRefinement refinement) { var tempGUID = Guid.NewGuid().ToString(); writer.WriteLine (@"""{0}""[shape=circle,width=.1,fixedsize=true,label=""""];", tempGUID); writer.WriteLine (@"""{0}"" -> ""{1}"" [arrowtail=onormal];", parent.Identifier, tempGUID); foreach (var child in refinement.SubObstacles()) { writer.WriteLine (@"""{0}"" -> ""{1}"" [arrowtail=none];", tempGUID, child.Identifier); } foreach (var child in refinement.DomainHypotheses()) { writer.WriteLine (@"""{0}"" -> ""{1}"" [arrowtail=none];", tempGUID, child.Identifier); } foreach (var child in refinement.DomainProperties()) { writer.WriteLine (@"""{0}"" -> ""{1}"" [arrowtail=none];", tempGUID, child.Identifier); } }
void DownPropagate(Obstacle parent, ObstacleRefinement refinement) { var alternatives_to_add = new List<AlternativeSystem> (parent.InSystems); if (refinement.InSystems == null) refinement.InSystems = new HashSet<AlternativeSystem> (); foreach (var a in alternatives_to_add) { refinement.InSystems.Add (a); } foreach (var child in refinement.SubObstacles()) { if (child.InSystems == null) child.InSystems = new HashSet<AlternativeSystem> (); foreach (var a in alternatives_to_add) { child.InSystems.Add (a); } DownPropagate (child); } }