Show
Ignore:
Timestamp:
03/22/07 22:41:18 (2 years ago)
Author:
ug
Message:

Fixed bug w.r.t. pattern anchors in hash_center search. Further small changes.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • 06/libkombilo-branches/hash_center/test_hash_center2.py

    r242 r243  
    5252                      (gl.lookupLabel(x,y), cont.B, cont.wB, cont.lB, cont.W, cont.wW, cont.lW)) 
    5353 
    54     if nh_result != h_result: 
    55         print nh_result 
    56         print h_result 
    57         raise Exception() 
     54    if ''.join(nh_result) != ''.join(h_result): 
     55        out1 = open('nh_result', 'ab') 
     56        out1.write(''.join(nh_result)) 
     57        out1.close() 
     58        out2 = open('h_result', 'ab') 
     59        out2.write(''.join(h_result)) 
     60        out1.close() 
    5861    return (nohash_time, hash_time)  
    5962 
     
    102105 
    103106start = time.time() 
    104 gl = GameList('t1.db') 
     107gl = GameList(sys.argv[1] + '.db') 
    105108end = time.time() 
    106109print gl.size(), 'games in the database' 
     
    108111for pattern in pl: 
    109112    print pattern.printPattern() 
    110     print 'nh, h:', timed_search(gl, pattern) 
     113    print timed_search(gl, pattern) 
     114    print 'num hits:', gl.num_hits 
     115    print '..................................................................' 
     116    print 
    111117