diff --git a/pyFTS/partitioners/Grid.py b/pyFTS/partitioners/Grid.py index 2b1b14f..ee18bb6 100644 --- a/pyFTS/partitioners/Grid.py +++ b/pyFTS/partitioners/Grid.py @@ -22,11 +22,12 @@ class GridPartitioner(partitioner.Partitioner): kwargs = {'type': self.type, 'variable': self.variable} - dlen = self.max - self.min - partlen = dlen / self.partitions + #dlen = self.max - self.min + #partlen = dlen / self.partitions count = 0 - for c in np.arange(self.min, self.max, partlen): + centers, partlen = np.linspace(self.min, self.max, self.partitions, retstep=True) + for c in centers: _name = self.get_name(count) if self.membership_function == Membership.trimf: sets[_name] = FuzzySet.FuzzySet(_name, Membership.trimf, [c - partlen, c, c + partlen],c,**kwargs)