Package schlachtfeld :: Module bias_testen
[hide private]
[frames] | no frames]

Source Code for Module schlachtfeld.bias_testen

 1  #!/bin/env python 
 2  # encoding: utf-8 
 3   
 4  # Schlachtfeld - Großkämpfe im EWS System 
 5  #   http://rpg-tools-1d6.sf.net 
 6  # Copyright © 2007 - 2007 Achim Zien 
 7   
 8  # This program is free software; you can redistribute it and/or modify 
 9  # it under the terms of the GNU General Public License as published by 
10  # the Free Software Foundation; either version 2 of the License, or 
11  # (at your option) any later version. 
12   
13  # This program is distributed in the hope that it will be useful, 
14  # but WITHOUT ANY WARRANTY; without even the implied warranty of 
15  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
16  # GNU General Public License for more details. 
17   
18  # You should have received a copy of the GNU General Public License 
19  # along with this program; if not, write to the Free Software 
20  # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, 
21  # MA 02110-1301 USA 
22   
23   
24  # This funktion just tests the bias with 5 fighters against varying numbers of fighters (i) (up to 20) and different values for the bias cutoff (i) 
25   
26  import math 
27   
28  for i in range(5):   
29          #: The precomputation of the logarythmus of the verhältnis, base 1.. Is used to compute the bias. 4  
30          q = math.log(float(5)/max(i, 1),1.4) 
31          print 'q wäre', q 
32          for j in range(20):  
33                  # cutoff for high biases: Divide through your own numbersdivided by a certain number. 
34                  bias = int(round(4.0 * q/(1+abs(q)/max(j,1)))) 
35                  print 'für 5 gegen', max(i, 1), 'gibt es bei', max(j, 1), 'einen Bias von', bias 
36