I was reading Rike Koi and was urged to make a mood value calculation program, so I made it.
I tried to prove the mood value because I fell in love with science. It is a numerical value of the mood that appears in Volume 3.
(From Rikekuma's Terminology Corner)
Define the mood value as follows
M = P_1 + P_2 + P_3 + P_4 + P_5\quad(-∞<M\leqq100)
・ P 1 </ sub> (Beauty index) = x 1 </ sub> (Average score indicating the beauty and fashion of the place)
x_1=\frac{1}{n}\sum_{i=1}^{n}\frac{1}{5}a_i\quad(-∞<a_1\leqq100,n is the number of evaluators)
・ P 2 </ sub> (third party index) If the number of people paying attention to this is x 2 </ sub>
\begin{align}
&x_2=When 0, P_2=20\\
&x_2>When 0, P_2=-10000x_2.
\end{align}
・ P 3 </ sub> (illuminance index) x 3 </ sub> = Illuminance on the spot (lux)
P_3 = \frac{1}{5}{104-2(\frac{x_3}{20}+\frac{20}{x_3})}
・ P 4 </ sub> (Quietness index) If the noise level [db] on the spot is x 4 </ sub>
\begin{align}
&0\leqq x_4 <At 20 t=100\\
&20\leqq x_4 <At 70 t=100-2(x_4-20)\\
&70\leqq x_4 At the time P_4=-∞
\end{align}
・ P 5 </ sub> (Gaze index) If the number of seconds for silent staring is x 5 </ sub>
\begin{align}
&0<x_5<At 30 S=\frac{100}{30}x_5\\
&30\leqq x_5 \When leqq60 S=100\\
&60<x_5 At the time S= 100-5(x_5-60)
\end{align}
Mood value.py
# M = P1+P2+P3+P4+P5 (-∞<M<=100)
# P1
# P1 = x1
n = int(input('Number of evaluators:'))
m = 1
a = 0
for _ in range(n):
ai = int(input(str(m) + 'Eye evaluation:'))
m += 1
a = a + ai
x1 = (a / 5) / n
P1 = x1
# P2
x2 = int(input('The number of people paying attention to this:'))
if x2 == 0:
P2 = 20
else:
P2 = -10000 * x2
# P3
x3 = float(input('Illuminance on the spot(lux):'))
P3 = (104 - 2 * (x3 / 20 + 20 / x3)) / 5
# P4
x4 = float(input('Noise level on the spot[db]:'))
if 0 <= x4 < 20:
t = 100
M = None
elif 20 <= x4 < 70:
t = 100 - 2 * (x4 - 20)
M = None
else:
M = '-∞'
if not M == '-∞':
P4 = 30 - 1000 / t
else:
pass
# P5
x5 = float(input('Silence staring seconds:'))
if 0 < x5 < 30:
S = 100 * x5 / 30
elif 30 <= x5 <= 60:
S = 100
else:
S = 100 - 5 * (x5 - 60)
P5 = S / 5
# M
if M == '-∞':
pass
else:
M = P1 + P2 + P3 + P4 + P5
print('Mood value=' + str(M) + 'md')
I feel that the following program is more beautiful for finding P 1 </ sub>
# P1
#P1 = x1
n = int(input('Number of evaluators:'))
a = []
for m in range(n):
ai = int(input(str(m + 1) + 'Eye evaluation:'))
a.append(ai)
x1 = sum(a) / 5 / n
P1 = x1
Rike love is interesting so please read it. Animation also starts from 1/10, so by all means !!!
Recommended Posts