Example #1
0
import os
from perfTabs import *
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()