Example #1
0
 /// <summary>
 /// I can't for the life of me get hg to indicate parentage in the "hg log" (even with templates
 /// asking for parents), if the revision is not the result of a merge.  And yet, it's expensive
 /// to ask again for every single one.  So as a hack, for now, this  can be called on a revision
 /// where we really need to know the parent.
 /// </summary>
 public void EnsureParentRevisionInfo()
 {
     if (this.Parents.Count == 0)
     {
         Parents.AddRange(_repository.GetParentsRevisionNumbers(this.Number.LocalRevisionNumber));
     }
 }
        public void SwapChildrenAndParents()
        {
            List <RenderablePathPoint> children = new List <RenderablePathPoint>();
            List <RenderablePathPoint> parents  = new List <RenderablePathPoint>();

            foreach (var child in Children)
            {
                if (child.IsSelected())
                {
                    children.Add(child);
                }
            }
            foreach (var parent in Parents)
            {
                if (parent.IsSelected())
                {
                    parents.Add(parent);
                }
            }

            foreach (var parent in parents)
            {
                parent.Children.Remove(this);
            }
            foreach (var child in children)
            {
                child.Parents.Remove(this);
            }

            foreach (var child in children)
            {
                Children.Remove(child);
            }
            foreach (var parent in parents)
            {
                Parents.Remove(parent);
            }

            Parents.AddRange(children);
            Children.AddRange(parents);

            foreach (var parent in Parents)
            {
                parent.Children.Add(this);
            }
            foreach (var child in Children)
            {
                child.Parents.Add(this);
            }
        }
        public EvacueeNode(IVertex v, IReadOnlyCollection <BlockageNode> blockageNodes)
        {
            V             = v;
            Name          = $"Evacuee {V.Name}";
            BlockageNodes = new List <BlockageNode>(blockageNodes);
            Parents.AddRange(blockageNodes);

            Table.Add(NewTuple(), 1 - Constants.LeakageProbability);
            for (var i = BlockageNodes.Count; i > 0; i--)
            {
                var tuple = NewTuple().Flip(i);
                var prob  = Constants.EvacuationProbability * (BlockageNodes[i - 1].E.Weight > Constants.EvacuationEdgeWeight
                               ? Constants.EvacuationMultiplier
                               : 1);
                Table.Add(tuple, 1 - prob);
            }

            BuildTable();
        }
Example #4
0
 public ClassRepresentationBuilder InheritsFrom(IEnumerable <string> toInherit)
 {
     Parents.AddRange(toInherit);
     return(this);
 }