Improvement suggested by FABRICIO JAVIER ERAZO COSTA, replace np.arange for np.linspace

This commit is contained in:
Petrônio Cândido de Lima e Silva 2023-03-20 11:11:12 -03:00 committed by GitHub
parent 5757fa34e5
commit df629077e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,7 +26,7 @@ class GridPartitioner(partitioner.Partitioner):
partlen = dlen / self.partitions partlen = dlen / self.partitions
count = 0 count = 0
for c in np.arange(self.min, self.max, partlen): for c in np.linspace(self.min, self.max, self.partitions, endpoint=False):
_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)