2017-01-11 00:05:51 +04:00
|
|
|
import numpy as np
|
|
|
|
|
|
|
|
|
2016-12-22 20:15:07 +04:00
|
|
|
class FLR:
|
|
|
|
def __init__(self, LHS, RHS):
|
|
|
|
self.LHS = LHS
|
|
|
|
self.RHS = RHS
|
|
|
|
|
|
|
|
def __str__(self):
|
2017-01-11 00:05:51 +04:00
|
|
|
return self.LHS.name + " -> " + self.RHS.name
|
|
|
|
|
2016-12-22 20:15:07 +04:00
|
|
|
|
|
|
|
def generateNonRecurrentFLRs(fuzzyData):
|
|
|
|
flrs = {}
|
|
|
|
for i in range(2,len(fuzzyData)):
|
|
|
|
tmp = FLR(fuzzyData[i-1],fuzzyData[i])
|
|
|
|
flrs[str(tmp)] = tmp
|
|
|
|
ret = [value for key, value in flrs.items()]
|
|
|
|
return ret
|
|
|
|
|
|
|
|
def generateRecurrentFLRs(fuzzyData):
|
|
|
|
flrs = []
|
|
|
|
for i in np.arange(1,len(fuzzyData)):
|
|
|
|
flrs.append(FLR(fuzzyData[i-1],fuzzyData[i]))
|
|
|
|
return flrs
|