示例#1
0
def get_consistent_deltas(perfmax,modifier):
    
    possibles = []
    
    LL = [modifier.get_modifications(k,hgetattr(perfmax,k)) for k in modifier.params]

    D = itertools.product(*LL)
    
    for d in D:
        c_copy = deepcopy(perfmax)
        for (ind,k) in enumerate(modifier.params):
            print k, d[ind]
            hsetattr(c_copy,k,d[ind]) 
       
        possibles.append(c_copy)
            
    return possibles
 def get_vector(self,x0,x1,k):
     if k in ['filter.divfreqs','filter.kshape']:
         return 1 if (hgetattr(x1,k)[0] > hgetattr(x0,k)[0] ) else (-1 if (hgetattr(x1,k)[0] <  hgetattr(x0,k)[0]) else 0)
     else:
         raise ValueError, k + ' is not a recognized value'