Exemplo n.º 1
0
from outrankingDigraphs import BipolarOutrankingDigraph

make_path = lambda x: os.path.join('..', 'report', 'figures', x.lower())
printline = lambda: print(80 * '-')

pt = XMCDA2PerformanceTableau('project_2')
full_digraph = BipolarOutrankingDigraph(pt)

printline()
print('Ranking')
printline()
print('Transitivity degree {}'.format(
    full_digraph.computeTransitivityDegree()))
printline()
print('Chorless circuits')
full_digraph.computeChordlessCircuits()
full_digraph.showChordlessCircuits()
printline()
print('')

from linearOrders import CopelandOrder
cop = CopelandOrder(full_digraph)
print('The Copeland ranking')
cop.showRanking()
printline()
cop_corr = full_digraph.computeOrdinalCorrelation(cop)
print("Fitness of Copeland's ranking: %.3f" % cop_corr['correlation'])
printline()
print('')

from linearOrders import NetFlowsOrder
Exemplo n.º 2
0
###Q1###
print('-' * 10, 'Question1', '-' * 10)
# load the tableau
tab = PerformanceTableau('perfTab_28')
print(tab)
tab.showHTMLPerformanceHeatmap(Correlations=True, ndigits=0, colorLevels=9)

input("Press Enter to continue...")

###Q2###
print('-' * 10, 'Question2', '-' * 10)
from outrankingDigraphs import BipolarOutrankingDigraph as BipolarOD
# bipolar outranking digraph
bipolar = BipolarOD(tab)
# compute chordless circuits
bipolar.computeChordlessCircuits()
# show computed chordless circuits
bipolar.showChordlessCircuits()

input("Press Enter to continue...")

###Q3###
print('-' * 10, 'Question3', '-' * 10)
#Copeland Ranking
cop = CopelandOrder(bipolar)
cop_corr = bipolar.computeOrdinalCorrelation(cop).get('correlation')
print(f'Correlation of Copeland order {cop_corr}')
#Kohler Ranking
koh = KohlerOrder(bipolar)
koh_corr = bipolar.computeOrdinalCorrelation(koh).get('correlation')
print(f'Correlation of Kohler order {koh_corr}')