03.01.2015 Views

Combining Information from Multiple Internet Sources

Combining Information from Multiple Internet Sources

Combining Information from Multiple Internet Sources

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Listing 3.2.3 presents the pseudo code for the main process of the Auction method.<br />

Input: Map containing URL rankings.<br />

Output: 10 URLs.<br />

BEGIN<br />

1. repeat until there are 10 URLs in answer list<br />

2. repeat until one agent remains<br />

3. find highest ranked URLs for all agents and pair them like<br />

( i) ( i)<br />

( A , U )<br />

4. calculate costs for each agent:<br />

cost<br />

( i )<br />

( A )<br />

i=∑ =<br />

1, i=<br />

j<br />

Listing 3.2.3 Auction method main algorithm<br />

Following activity diagram presents the Auction method workflow. Like in the previous case<br />

all objects in the process are shown on this diagram so that it can be easily seen who is responsible<br />

for certain parts of the process.<br />

=<br />

i<br />

m<br />

rank<br />

( i) ( i)<br />

( i) ( j )<br />

( A , U ) − rank A , U<br />

10<br />

( )<br />

where U ( i)<br />

( i) ( i)<br />

is URL <strong>from</strong> pair ( A , U ) (highest ranked URL for<br />

agent A ( i ) and U ( j ) is a highest ranked URL for agent A<br />

( j )<br />

5. find agent with highest cost – he is a loser<br />

• it may happen that all agents have the same costs – if it<br />

occurs twice the agent which is assigned the URL initially<br />

ranked as the lowest is considered a loser and thus removed<br />

<strong>from</strong> further negotiation, if it so go to 7.<br />

6. if the agent is a loser twice in a row remove him <strong>from</strong> further<br />

auction<br />

7. update URL rankings for all agents with following values:<br />

( i) ( i)<br />

( i) ( i)<br />

( i)<br />

rank( A , U ) = rank( A , U ) − cost( A )<br />

( i) ( i)<br />

where ( A , U ) is the pair found at the beginning; at this<br />

point the winning URL can be changed<br />

8. add URL to answer list<br />

9. remove the URL <strong>from</strong> further evaluation<br />

10. go to 2<br />

END<br />

31

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!