comparison transformations/Rature.py @ 63:7949f46b03e0

Bug a propos de complexity=0 corrige
author SylvainPL <sylvain.pannetier.lebeuf@umontreal.ca>
date Tue, 09 Feb 2010 11:43:09 -0500
parents fd02fd7e6557
children 9e5463ebd044
comparison
equal deleted inserted replaced
62:bab98bb47616 63:7949f46b03e0
43 self.orientation=0 43 self.orientation=0
44 elif choix <0.67: 44 elif choix <0.67:
45 self.orientation=1 45 self.orientation=1
46 else: 46 else:
47 self.orientation=2 47 self.orientation=2
48 48 if float(complexity) > 0:
49 self.largeur=min(32,max(1,int(numpy.ceil(complexity*5)*numpy.random.normal(1,float(complexity)/2)))) 49 self.largeur=min(32,max(1,int(numpy.ceil(complexity*5)*numpy.random.normal(1,float(complexity)/2))))
50 self.clarte=min(1,max(0,complexity*numpy.random.normal(1,float(complexity)/2))) 50 self.clarte=min(1,max(0,complexity*numpy.random.normal(1,float(complexity)/2)))
51 self.faire=numpy.random.binomial(1,float(complexity)) 51 self.faire=numpy.random.binomial(1,float(complexity))
52 else:
53 self.largeur=0
54 self.clarte=0
55 self.faire=0 #On ne fait rien !!!
52 56
53 return self._get_current_parameters() 57 return self._get_current_parameters()
54 58
55 def _get_current_parameters(self): 59 def _get_current_parameters(self):
56 return [self.orientation,self.largeur,self.clarte,self.faire] 60 return [self.orientation,self.largeur,self.clarte,self.faire]