return antichains XMCDA_URL = 'http://www.decision-deck.org/2009/XMCDA-2.1.0' if __name__ == "__main__": if len(sys.argv) != 3: print("usage: %s n filename" % sys.argv[0]) sys.exit(1) n = int(sys.argv[1]) c = Criteria([Criterion("c%d" % i) for i in range(1, n + 1)]) print(c) a = antichains(c.keys()) f = bz2.BZ2File("%s" % sys.argv[2], "w") xmcda = ElementTree.Element("{%s}XMCDA" % XMCDA_URL) xmcda.append(c.to_xmcda()) i = 1 for anti in a: if anti is None: continue print(anti) xmcda.append(anti.to_xmcda(str(i))) i += 1 print(len(a))
gmaxs.discard(s2) return gmaxs XMCDA_URL = 'http://www.decision-deck.org/2009/XMCDA-2.1.0' if __name__ == "__main__": f = bz2.BZ2File(sys.argv[1]) tree = ElementTree.parse(f) root = tree.getroot() xmcda_criteria = root.find(".//criteria") c = Criteria().from_xmcda(xmcda_criteria) print(c) cids = c.keys() f.close() c_pset = CriteriaSets(set(CriteriaSet(i) for i in powerset(c.keys()))) xmcda_csets = root.findall(".//criteriaSets") i = 0 xmcda2 = ElementTree.Element("{%s}XMCDA" % XMCDA_URL) xmcda2.append(xmcda_criteria) xmcda3 = ElementTree.Element("{%s}XMCDA" % XMCDA_URL) xmcda3.append(xmcda_criteria) for xmcda in xmcda_csets: fmins = CriteriaSets().from_xmcda(xmcda) gmaxs = compute_gmax(c_pset, fmins)
__antichains(CriteriaSets([combi]), combi, combis, antichains) return antichains XMCDA_URL = 'http://www.decision-deck.org/2009/XMCDA-2.1.0' if __name__ == "__main__": if len(sys.argv) != 3: print("usage: %s n filename" % sys.argv[0]) sys.exit(1) n = int(sys.argv[1]) c = Criteria([Criterion("c%d" % i) for i in range(1, n + 1)]) print(c) a = antichains(c.keys()) f = bz2.BZ2File("%s" % sys.argv[2], "w") xmcda = ElementTree.Element("{%s}XMCDA" % XMCDA_URL) xmcda.append(c.to_xmcda()) i = 1 for anti in a: if anti is None: continue print(anti) xmcda.append(anti.to_xmcda(str(i))) i += 1 print(len(a))