Changeset 9732:470857cc675f in orange


Ignore:
Timestamp:
02/06/12 13:24:27 (2 years ago)
Author:
crt.gorup@…
Branch:
default
rebase_source:
2e30e69e10162bf7d78df75d6f165c7f3c2370b0
Message:

Uses random generator from Orange.misc.random.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/misc/selection.py

    r9671 r9732  
    103103     
    104104    def __init__(self, compare=cmp, seed = 0, call_compare_on_1st = False): 
    105         self.randomGenerator = random.Random(seed) 
     105        self.randomGenerator = random.RandomGenerator(seed) 
    106106        self.compare=compare 
    107107        self.wins=0 
     
    134134            elif cmpr==0: 
    135135                self.wins=self.wins+1 
    136                 if not self.randomGenerator.randint(0, self.wins-1): 
     136                if not self.randomGenerator(self.wins): 
    137137                    self.best=x 
    138138                    self.bestIndex=self.index 
Note: See TracChangeset for help on using the changeset viewer.