public void addRelation(Entity entity, TLinkType trc) { if (relations_.ContainsKey(entity)) { relations_[entity] = trc; } else { relations_.Add(entity, trc); } }
public TLinkType getRelation(Entity entity) { TLinkType ret = TLinkType.OVERLAP; if (relations_.TryGetValue(entity, out ret)) { return(ret); } else { return(TLinkType.OVERLAP); } }
private static string get_type_string(TLinkType type) { switch (type) { case TLinkType.AFTER: return("AFTER"); case TLinkType.BEFORE: return("BEFORE"); case TLinkType.OVERLAP: return("OVERLAP"); case TLinkType.OTHER: return("OTHER"); } return("OVERLAP"); }
private bool get_equivalent_tlink(EntityLink link, ref List <EntityLink> std_links, out TLinkType type) { Entity target_from = link.from; Entity target_to = link.to; type = TLinkType.OTHER; for (int i = 0; i < std_links.Count; i++) { Entity std_from = std_links[i].from; Entity std_to = std_links[i].to; if (is_same_concept(target_from, std_from) && is_same_concept(target_to, std_to)) { switch (std_links[i].type) { case TLinkType.AFTER: type = TLinkType.AFTER; break; case TLinkType.BEFORE: type = TLinkType.BEFORE; break; case TLinkType.OTHER: type = TLinkType.OTHER; break; case TLinkType.OVERLAP: type = TLinkType.OVERLAP; break; } return(true); } if (is_same_concept(target_from, std_to) && is_same_concept(target_to, std_from)) { switch (std_links[i].type) { case TLinkType.AFTER: type = TLinkType.BEFORE; break; case TLinkType.BEFORE: type = TLinkType.AFTER; break; case TLinkType.OTHER: type = TLinkType.OTHER; break; case TLinkType.OVERLAP: type = TLinkType.OVERLAP; break; } return(true); } } return(false); }