public bool IsEqualTo(DependencyZone zone, DependencyZone.DuplicityFilter filter) { switch (filter) { case DuplicityFilter.MultiEgo: return(AreEqual(this.InnerZone, zone.InnerZone, filter)); case DuplicityFilter.All: return(AreEqual(this.AllVertices, zone.AllVertices, filter)); default: return(false); } }
public ZoneGroups(DependencyZones zones, GroupingStrategy strategy, bool nonZonesOnly, double dependencyThreshold) { this.zones = zones; this.DUPLICITY_FILTER = this.zones.DUPLICITY_FILTER; if (this.DUPLICITY_FILTER == DependencyZone.DuplicityFilter.MultiEgo) { this.DUPLICITY_FILTER = DependencyZone.DuplicityFilter.All; } this.AllGroups = new List <ZoneGroup>(); this.Strategy = strategy; this.NonZonesOnly = nonZonesOnly; this.DependencyThreshold = dependencyThreshold; this.calculateGroups(); this.CompleteAndFilterDuplicities(); }
public DependencyZones(Network net, int minSize, int maxSize, bool outerZone, DependencyZone.DuplicityFilter duplicityFilter, ProminencyFilter prominencyFilter, double dependencyThreshold) { this.Network = net; this.egoToZoneDictionary = new Dictionary <Vertex, DependencyZone>(); this.AllZones = new List <DependencyZone>(); this.Memberships = new Dictionary <Vertex, VertexMemberships>(); this.Relationships = new Dictionary <DependencyZone, DependencyZoneRelationships>(); this.DUPLICITY_FILTER = duplicityFilter; this.PROMINENCY_FILTER = prominencyFilter; this.DependencyThreshold = dependencyThreshold; this.calculateZones(minSize, maxSize, outerZone); this.CompleteAndFilterDuplicities(); }
public static bool AreEqual(HashSet <Vertex> setA, HashSet <Vertex> setB, DependencyZone.DuplicityFilter filter) //ignoruje MultiEgo, povazuje ho za All { if (filter == DuplicityFilter.None || setA.Count != setB.Count) { return(false); } else { foreach (Vertex v in setA) { if (!setB.Contains(v)) { return(false); } } } return(true); }