File size: 11,903 Bytes
41371f1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
import skfuzzy as fuzz
from skfuzzy import control as crt
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as ml
import streamlit as st
import math

st.title('Schematic Design')


tanasobat=crt.Antecedent(np.arange(0,3.05,0.05),'c')
jahat=crt.Antecedent(np.arange(0,25.1,0.1),'a')
jerm_hararati=crt.Antecedent(np.arange(0,4185.1,0.1),'b')
feshordegi=crt.Antecedent(np.arange(0,1,0.01),'d')
ertefa=crt.Antecedent(np.arange(2.3,10.001,0.001),'e')
WWR=crt.Antecedent(np.arange(0,1.001,0.001),'f')
emtiaz_HH=crt.Consequent(np.arange(-4,24.01,0.01),'score')
g1=st.sidebar.radio('climate',['hot and humid'])
jahat['low']=fuzz.trimf(jahat.universe,[0,5,12])
jahat['medium']=fuzz.trimf(jahat.universe,[5,12,17.5])
jahat['re_hight']=fuzz.trimf(jahat.universe,[12,17.5,25])
jahat['high']=fuzz.trimf(jahat.universe,[17.5,25,25])

jerm_hararati['low']=fuzz.trapmf(jerm_hararati.universe,[0,0,1500,1600])
jerm_hararati['medium']=fuzz.trapmf(jerm_hararati.universe,[1500,2000,3000,3500])
jerm_hararati['high']=fuzz.trapmf(jerm_hararati.universe,[3000,3500,4185,4185])


tanasobat['low']=fuzz.trapmf(tanasobat.universe,[0,1.1,1.3,1.4])
tanasobat['medium']=fuzz.trapmf(tanasobat.universe,[1.2,1.4,1.6,1.7])
tanasobat['high']=fuzz.trapmf(tanasobat.universe,[1.6,1.7,3,3])


feshordegi['low']=fuzz.trapmf(feshordegi.universe,[0,0.2,0.5,0.6])
feshordegi['medium']=fuzz.trapmf(feshordegi.universe,[0.5,0.6,0.8,0.85])
feshordegi['high']=fuzz.trapmf(feshordegi.universe,[0.8,0.85,1,1])

ertefa['low']=fuzz.gbellmf(ertefa.universe,0.3,6,2.4)
ertefa['medium']=fuzz.gbellmf(ertefa.universe,0.2,6,3)
ertefa['high']=fuzz.smf(ertefa.universe,3.2,3.6)

WWR['low']=fuzz.gbellmf(WWR.universe,0.05,4,0.15)
#WWR['medium']=fuzz.gbellmf(WWR.universe,0.05,6,0.25)
WWR['RE_high']=fuzz.gbellmf(WWR.universe,0.05,4,0.30)
WWR['high']=fuzz.smf(WWR.universe,0.35,0.45)

emtiaz_HH['awful']=fuzz.gaussmf(emtiaz_HH.universe,0,1)
emtiaz_HH['bad']=fuzz.gaussmf(emtiaz_HH.universe,4,1)
emtiaz_HH['not_bad']=fuzz.gaussmf(emtiaz_HH.universe,8,1)
emtiaz_HH['good']=fuzz.gaussmf(emtiaz_HH.universe,12,1)
emtiaz_HH['very_good']=fuzz.gaussmf(emtiaz_HH.universe,16,1)
emtiaz_HH['excelent']=fuzz.gaussmf(emtiaz_HH.universe,20,1)


r1=crt.Rule(jahat['low']&jerm_hararati['low']&tanasobat['high']&feshordegi['low']&ertefa['high']&WWR['RE_high'],emtiaz_HH['excelent'])

r2=crt.Rule(~jahat['low']&jerm_hararati['low']&tanasobat['high']&feshordegi['low']&ertefa['high']&WWR['RE_high'],emtiaz_HH['very_good'])
r3=crt.Rule(jahat['low']&~jerm_hararati['low']&tanasobat['high']&feshordegi['low']&ertefa['high']&WWR['RE_high'],emtiaz_HH['very_good'])
r4=crt.Rule(jahat['low']&jerm_hararati['low']&~tanasobat['high']&feshordegi['low']&ertefa['high']&WWR['RE_high'],emtiaz_HH['very_good'])
r5=crt.Rule(jahat['low']&jerm_hararati['low']&tanasobat['high']&~feshordegi['low']&ertefa['high']&WWR['RE_high'],emtiaz_HH['very_good'])
r6=crt.Rule(jahat['low']&jerm_hararati['low']&tanasobat['high']&feshordegi['low']&~ertefa['high']&WWR['RE_high'],emtiaz_HH['very_good'])
r7=crt.Rule(jahat['low']&jerm_hararati['low']&tanasobat['high']&feshordegi['low']&ertefa['high']&~WWR['RE_high'],emtiaz_HH['very_good'])


r8=crt.Rule(~jahat['low']&~jerm_hararati['low']&tanasobat['high']&feshordegi['low']&ertefa['high']&WWR['RE_high'],emtiaz_HH['good'])
r9=crt.Rule(~jahat['low']&jerm_hararati['low']&~tanasobat['high']&feshordegi['low']&ertefa['high']&WWR['RE_high'],emtiaz_HH['good'])
r10=crt.Rule(~jahat['low']&jerm_hararati['low']&tanasobat['high']&~feshordegi['low']&ertefa['high']&WWR['RE_high'],emtiaz_HH['good'])
r11=crt.Rule(~jahat['low']&jerm_hararati['low']&tanasobat['high']&feshordegi['low']&~ertefa['high']&WWR['RE_high'],emtiaz_HH['good'])
r12=crt.Rule(~jahat['low']&jerm_hararati['low']&tanasobat['high']&feshordegi['low']&ertefa['high']&~WWR['RE_high'],emtiaz_HH['good'])


r13=crt.Rule(jahat['low']&~jerm_hararati['low']&~tanasobat['high']&feshordegi['low']&ertefa['high']&WWR['RE_high'],emtiaz_HH['good'])
r14=crt.Rule(jahat['low']&~jerm_hararati['low']&tanasobat['high']&~feshordegi['low']&ertefa['high']&WWR['RE_high'],emtiaz_HH['good'])
r15=crt.Rule(jahat['low']&~jerm_hararati['low']&tanasobat['high']&feshordegi['low']&~ertefa['high']&WWR['RE_high'],emtiaz_HH['good'])
r16=crt.Rule(jahat['low']&~jerm_hararati['low']&tanasobat['high']&feshordegi['low']&ertefa['high']&~WWR['RE_high'],emtiaz_HH['good'])


r17=crt.Rule(jahat['low']&jerm_hararati['low']&~tanasobat['high']&~feshordegi['low']&ertefa['high']&WWR['RE_high'],emtiaz_HH['good'])
r18=crt.Rule(jahat['low']&jerm_hararati['low']&~tanasobat['high']&feshordegi['low']&~ertefa['high']&WWR['RE_high'],emtiaz_HH['good'])
r19=crt.Rule(jahat['low']&jerm_hararati['low']&~tanasobat['high']&feshordegi['low']&ertefa['high']&~WWR['RE_high'],emtiaz_HH['good'])


r20=crt.Rule(jahat['low']&jerm_hararati['low']&tanasobat['high']&~feshordegi['low']&~ertefa['high']&WWR['RE_high'],emtiaz_HH['good'])
r21=crt.Rule(jahat['low']&jerm_hararati['low']&tanasobat['high']&~feshordegi['low']&ertefa['high']&~WWR['RE_high'],emtiaz_HH['good'])

r22=crt.Rule(jahat['low']&jerm_hararati['low']&tanasobat['high']&feshordegi['low']&~ertefa['high']&~WWR['RE_high'],emtiaz_HH['good'])

r23=crt.Rule(~jahat['low']&~jerm_hararati['low']&~tanasobat['high']&feshordegi['low']&ertefa['high']&WWR['RE_high'],emtiaz_HH['not_bad'])
r24=crt.Rule(~jahat['low']&~jerm_hararati['low']&tanasobat['high']&~feshordegi['low']&ertefa['high']&WWR['RE_high'],emtiaz_HH['not_bad'])
r25=crt.Rule(~jahat['low']&~jerm_hararati['low']&tanasobat['high']&feshordegi['low']&~ertefa['high']&WWR['RE_high'],emtiaz_HH['not_bad'])
r26=crt.Rule(~jahat['low']&~jerm_hararati['low']&tanasobat['high']&feshordegi['low']&ertefa['high']&~WWR['RE_high'],emtiaz_HH['not_bad'])
r27=crt.Rule(~jahat['low']&jerm_hararati['low']&~tanasobat['high']&~feshordegi['low']&~ertefa['high']&WWR['RE_high'],emtiaz_HH['not_bad'])
r28=crt.Rule(~jahat['low']&jerm_hararati['low']&~tanasobat['high']&feshordegi['low']&~ertefa['high']&WWR['RE_high'],emtiaz_HH['not_bad'])
r29=crt.Rule(~jahat['low']&jerm_hararati['low']&~tanasobat['high']&feshordegi['low']&ertefa['high']&~WWR['RE_high'],emtiaz_HH['not_bad'])
r30=crt.Rule(~jahat['low']&jerm_hararati['low']&tanasobat['high']&~feshordegi['low']&~ertefa['high']&WWR['RE_high'],emtiaz_HH['not_bad'])
r31=crt.Rule(~jahat['low']&jerm_hararati['low']&tanasobat['high']&~feshordegi['low']&ertefa['high']&~WWR['RE_high'],emtiaz_HH['not_bad'])
r32=crt.Rule(~jahat['low']&jerm_hararati['low']&tanasobat['high']&feshordegi['low']&~ertefa['high']&~WWR['RE_high'],emtiaz_HH['not_bad'])

r33=crt.Rule(jahat['low']&~jerm_hararati['low']&~tanasobat['high']&~feshordegi['low']&ertefa['high']&WWR['RE_high'],emtiaz_HH['not_bad'])
r34=crt.Rule(jahat['low']&~jerm_hararati['low']&~tanasobat['high']&feshordegi['low']&~ertefa['high']&WWR['RE_high'],emtiaz_HH['not_bad'])
r35=crt.Rule(jahat['low']&~jerm_hararati['low']&~tanasobat['high']&feshordegi['low']&~ertefa['high']&WWR['RE_high'],emtiaz_HH['not_bad'])
r36=crt.Rule(jahat['low']&~jerm_hararati['low']&~tanasobat['high']&feshordegi['low']&ertefa['high']&~WWR['RE_high'],emtiaz_HH['not_bad'])


r37=crt.Rule(jahat['low']&jerm_hararati['low']&~tanasobat['high']&~feshordegi['low']&~ertefa['high']&WWR['RE_high'],emtiaz_HH['not_bad'])
r38=crt.Rule(jahat['low']&jerm_hararati['low']&~tanasobat['high']&~feshordegi['low']&ertefa['high']&~WWR['RE_high'],emtiaz_HH['not_bad'])
r39=crt.Rule(jahat['low']&jerm_hararati['low']&tanasobat['high']&~feshordegi['low']&~ertefa['high']&~WWR['RE_high'],emtiaz_HH['not_bad'])

r40=crt.Rule(~jahat['low']&~jerm_hararati['low']&~tanasobat['high']&~feshordegi['low']&ertefa['high']&WWR['RE_high'],emtiaz_HH['bad'])
r41=crt.Rule(~jahat['low']&~jerm_hararati['low']&~tanasobat['high']&feshordegi['low']&~ertefa['high']&WWR['RE_high'],emtiaz_HH['bad'])
r42=crt.Rule(~jahat['low']&~jerm_hararati['low']&~tanasobat['high']&~feshordegi['low']&ertefa['high']&~WWR['RE_high'],emtiaz_HH['bad'])
r43=crt.Rule(~jahat['low']&~jerm_hararati['low']&tanasobat['high']&~feshordegi['low']&~ertefa['high']&WWR['RE_high'],emtiaz_HH['bad'])
r44=crt.Rule(~jahat['low']&~jerm_hararati['low']&tanasobat['high']&~feshordegi['low']&ertefa['high']&~WWR['RE_high'],emtiaz_HH['bad'])
r45=crt.Rule(~jahat['low']&~jerm_hararati['low']&tanasobat['high']&feshordegi['low']&~ertefa['high']&~WWR['RE_high'],emtiaz_HH['bad'])
r46=crt.Rule(~jahat['low']&jerm_hararati['low']&~tanasobat['high']&~feshordegi['low']&~ertefa['high']&WWR['RE_high'],emtiaz_HH['bad'])
r47=crt.Rule(~jahat['low']&jerm_hararati['low']&~tanasobat['high']&~feshordegi['low']&ertefa['high']&~WWR['RE_high'],emtiaz_HH['bad'])
r48=crt.Rule(~jahat['low']&jerm_hararati['low']&tanasobat['high']&~feshordegi['low']&~ertefa['high']&~WWR['RE_high'],emtiaz_HH['bad'])

r49=crt.Rule(jahat['low']&~jerm_hararati['low']&~tanasobat['high']&~feshordegi['low']&~ertefa['high']&WWR['RE_high'],emtiaz_HH['bad'])
r50=crt.Rule(jahat['low']&~jerm_hararati['low']&~tanasobat['high']&~feshordegi['low']&ertefa['high']&~WWR['RE_high'],emtiaz_HH['bad'])
r51=crt.Rule(jahat['low']&~jerm_hararati['low']&~tanasobat['high']&feshordegi['low']&~ertefa['high']&~WWR['RE_high'],emtiaz_HH['bad'])
r52=crt.Rule(jahat['low']&~jerm_hararati['low']&~tanasobat['high']&~feshordegi['low']&~ertefa['high']&~WWR['RE_high'],emtiaz_HH['bad'])
r53=crt.Rule(jahat['low']&jerm_hararati['low']&~tanasobat['high']&~feshordegi['low']&~ertefa['high']&~WWR['RE_high'],emtiaz_HH['bad'])

r53=crt.Rule(jahat['low']&~jerm_hararati['low']&~tanasobat['high']&~feshordegi['low']&~ertefa['high']&~WWR['RE_high'],emtiaz_HH['awful'])
r54=crt.Rule(~jahat['low']&jerm_hararati['low']&~tanasobat['high']&~feshordegi['low']&~ertefa['high']&~WWR['RE_high'],emtiaz_HH['awful'])
r55=crt.Rule(~jahat['low']&~jerm_hararati['low']&tanasobat['high']&~feshordegi['low']&~ertefa['high']&~WWR['RE_high'],emtiaz_HH['awful'])
r56=crt.Rule(~jahat['low']&~jerm_hararati['low']&~tanasobat['high']&feshordegi['low']&~ertefa['high']&~WWR['RE_high'],emtiaz_HH['awful'])
r57=crt.Rule(~jahat['low']&~jerm_hararati['low']&~tanasobat['high']&~feshordegi['low']&ertefa['high']&~WWR['RE_high'],emtiaz_HH['awful'])
r58=crt.Rule(~jahat['low']&~jerm_hararati['low']&~tanasobat['high']&~feshordegi['low']&~ertefa['high']&WWR['RE_high'],emtiaz_HH['awful'])
r59=crt.Rule(~jahat['low']&~jerm_hararati['low']&~tanasobat['high']&~feshordegi['low']&~ertefa['high']&~WWR['RE_high'],emtiaz_HH['awful'])

cs=crt.ControlSystem([r1,
r2,
r3,
r4,
r5,
r6,
r7,
r8,
r9,
r10,
r11,
r12,
r13,
r14,
r15,
r16,
r17,
r18,
r19,
r20,
r21,
r22,
r23,
r24,
r25,
r26,
r27,
r28,
r29,
r30,
r31,
r32,
r33,
r34,
r35,
r36,
r37,
r38,
r39,
r40,
r41,
r42,
r43,
r44,
r45,
r46,
r47,
r48,
r49,
r50,
r51,
r52,
r53,r54,r55,r56,r57,r58,r59])
cs1=crt.ControlSystemSimulation(cs)


c1=cs1.input['c']=st.sidebar.slider("tanasobat",min_value=0.1,max_value=4.0,step=0.1,value=1.0)
a1=cs1.input['a']=st.sidebar.slider("jahat",min_value=0.00,max_value=40.00,step=0.1,value=0.0)
b1=cs1.input['b']=st.sidebar.slider("jerm_hararati",min_value=0.00,max_value=4180.00,step=0.1,value=0.0)

d1=cs1.input['d']=st.sidebar.slider("feshordegi",min_value=0.00,max_value=1.0,step=0.01,value=0.1)
e1=cs1.input['e']=st.sidebar.slider("ertefa",min_value=2.3,max_value=5.00,step=0.01,value=3.31)
f1=cs1.input['f']=st.sidebar.slider("wwr",min_value=0.00,max_value=1.00,step=0.01,value=0.20)

cs1.compute()
g11=cs1.output['score']

fig = plt.figure(figsize=[10,10])
img=ml.image.imread("bandar1.png")
ax = fig.add_subplot(1,1,1)
d1=str(d1)
i=0
r2=ml.patches.Rectangle((300+e1*6.4,150-e1*6.4),c1*60,60,angle=-a1,color=d1,alpha=0.4)
r=ml.patches.Rectangle((300,150),c1*60,60,angle=-a1,facecolor = 'none', edgecolor = 'black', linewidth = b1/200) 
r1=ml.patches.Rectangle((300,150),c1*60,60,angle=-a1,color=d1)
ax.add_patch(r2)
ax.add_patch(r1)
ax.add_patch(r)
ax.imshow(img)
st.header('your score is :')
st.header(g11)
st.set_option('deprecation.showPyplotGlobalUse', False)
st.pyplot()