Bugfix: Wrong number of partitions been generated by GridPartitioner
This commit is contained in:
parent
a027c89d29
commit
6a6eb77d0d
@ -22,11 +22,12 @@ class GridPartitioner(partitioner.Partitioner):
|
|||||||
|
|
||||||
kwargs = {'type': self.type, 'variable': self.variable}
|
kwargs = {'type': self.type, 'variable': self.variable}
|
||||||
|
|
||||||
dlen = self.max - self.min
|
#dlen = self.max - self.min
|
||||||
partlen = dlen / self.partitions
|
#partlen = dlen / self.partitions
|
||||||
|
|
||||||
count = 0
|
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)
|
_name = self.get_name(count)
|
||||||
if self.membership_function == Membership.trimf:
|
if self.membership_function == Membership.trimf:
|
||||||
sets[_name] = FuzzySet.FuzzySet(_name, Membership.trimf, [c - partlen, c, c + partlen],c,**kwargs)
|
sets[_name] = FuzzySet.FuzzySet(_name, Membership.trimf, [c - partlen, c, c + partlen],c,**kwargs)
|
||||||
|
Loading…
Reference in New Issue
Block a user