The Rubis Server layoutThe Rubis spool daemonThe Rubis problem solver

Contents

Index

The Rubis problem solver

The Rubis solver is implemented in Python and is based upon the digraphs Python module (see http://ernst-schroeder.uni.lu/Digraph). The script below illustrates the general commands required for solving a best choice decision problem.

#!/usr/bin/env python
# rubisSolver.py
# RB March 2008
#################

1: import digraphs

2: try:
3: 	ticket = sys.argv[1]
4:	problemFileName = '/var/rubisServerData/Problems/problem-'\
                           + str(ticket)
5:	t = digraphs.XMLRubisPerformanceTableau(problemFileName)
6:	g = digraphs.BipolarOutrankingDigraph(t)
7:	solutionFileName = '/var/rubisServerData/Solutions/outrankingDigraph-'\
                            + str(ticket)
8:	g.saveXMLRubisOutrankingDigraph(name=solutionFileName,\
                                        category=t.category,\
                                        subcategory=t.subcategory,\
                                        author=t.author,\
                                        reference=t.reference,\
                                        noSilent=False)
9:	graphFileName = '/var/rubisServerData/Images/rubisGraph-' + str(ticket)
10:	g.exportGraphViz(fileName=graphFileName,\
                         graphSize='10,10',\
                         graphType='png',\
                         bestChoice=g.goodChoices[0][5],\
                         worstChoice=g.badChoices[0][5])
11: except:
12:	solutionFileName = '/var/rubisServerData/Solutions/outrankingDigraph-'
                            + str(ticket) + '.xml'
13:	OUT = open(solutionFileName,'w')
14:	OUT.write('Error: rubis Solver could not compute\
                   the requested outranking digraph!')
15:	OUT.close()

In Line 1, the digraphs module is imported. We first try to solve the submitted problem (Lines 2 - 10). If this fails for some reason, an error message is returned instead of the solution file (see Lines 11 - 15).

Solving the problem is actually achieved through Lines 3 - 10, where the problem file name is constructed with the help of the ticket input parameter (Lines 3 - 4). The XML encoded Rubis performance tableau is then read into the Python variable t (Line 5) from the Problems directory.

In Line 6 we construct the bipolar-valued outranking digraph g from the given performance tableau t. After constructing the solution file name, we save the XML encoded complete Rubis results into the Solutions directory (Lines 7 - 8).

Finally, the corresponding graph file name is constructed (Line 9) and a GraphViz generated image in PNG format is saved in the Images directory. The most determined best and worst choice recommendations are marked golden respectively blue in the resulting image (Line 10).

For a precise documentation of the Rubis solver, it is helpful to directly consult the source code of these methods in the digraphs module source code. More information is available on the digraphs documentation pages (see http://ernst-schroeder.uni.lu/Digraph/).


Raymond Bisdorff, June 2, 2008


The Rubis Server layoutThe Rubis spool daemonThe Rubis problem solverContentsIndex