Bugfix: Wrong number of partitions been generated by GridPartitioner

This commit is contained in:
Petrônio Cândido de Lima e Silva 2022-10-24 15:19:37 -03:00 committed by GitHub
parent a027c89d29
commit 6a6eb77d0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)