1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 """Fuzzification which sets adjectives values according the values in given dictionary."""
20
21 __revision__ = "$Id: Dict.py,v 1.8 2010-10-29 19:24:41 rliebscher Exp $"
22
23 from fuzzy.fuzzify.Base import Base
24
25
27 """Fuzzification method which gets adjective memberships
28 in a dictionary instead of values to fuzzify.
29 You should use in the adjectives instances of Set itself.
30
31 Q : What can be done with this?
32
33 A : Break complexity, by divide big and heavy fuzzy
34 systems into small ones ::
35
36 input1 ----> *******
37 input2 ----> * FIS *
38 input3 ----> * * ------> output
39 input4 ----> *******
40
41 should be::
42
43 input1 ----> *******
44 input2 ----> *FIS 1* ----+
45 ******* |
46 +--> *******
47 input3 ----> ******* -------> *FIS 3* ----> output
48 input4 ----> *FIS 2* *******
49 *******
50
51 Q : Why don't defuzzify outputs of FIS1 and FIS2 ?
52
53 A : Defuzzification mean data loss.
54
55 """
56
59
61 """Do not let adjectives calculate their membership values.
62 Instead use the provided values from dictionary.
63
64 @param variable: variable which adjective to set
65 @type variable: L{fuzzy.Variable.Variable}
66 @param variable: values to set the adjectives
67 @type: dict
68 """
69 for adjective_key in value:
70 variable.adjectives[adjective_key].membership = value[adjective_key]
71 return None
72