<jupyter_start><jupyter_text>Ejercicio 1 - HeladeríaSe quiere calcular la catidad de clientes que tendrá una heladería dependiendo de la temperatura exterior.- Si la temperatura es alta entonces la heladería estará llena- Si la temperatura es moderada entonces la heladería estará ocupada- Si la temperatura es baja entonces la heladería estará tranquilaEl número máximo de clientes para el local es de 35 clientes.Definir los rangos de pertenencias para los antecedentes y consecuentes.<jupyter_code>%matplotlib inline
import numpy as np
import skfuzzy as fuzz
from skfuzzy import control as ctrl
import matplotlib
import matplotlib.pyplot as plt<jupyter_output><empty_output><jupyter_text>AntecendentesDefinir y graficar los antecedentes para el problema.<jupyter_code>temp = ctrl.Antecedent(np.arange(-20, 35, 1), "temp")
temp["low"] = fuzz.trapmf(temp.universe, [-20, -20, -5, 0])
temp["medium"] = fuzz.trimf(temp.universe, [-5, 15, 30])
temp["high"] = fuzz.trapmf(temp.universe, [15, 30, 35, 35])

temp.view()<jupyter_output>G:\Anaconda\lib\site-packages\skfuzzy\control\fuzzyvariable.py:122: UserWarning: Matplotlib is currently using module://ipykernel.pylab.backend_inline, which is a non-GUI backend, so cannot show the figure.
  fig.show()<jupyter_text>ConsecuentesDefinir y gráficar los antecedentes para el problema.<jupyter_code>quantity = ctrl.Consequent(np.arange(0, 36, 1), "quantity")
quantity["low"] = fuzz.trimf(quantity.universe, [0, 0, 10])
quantity["medium"] = fuzz.trimf(quantity.universe, [5, 20, 25])
quantity["high"] = fuzz.trapmf(quantity.universe, [20, 30, 35, 35])

quantity.view()<jupyter_output>G:\Anaconda\lib\site-packages\skfuzzy\control\fuzzyvariable.py:122: UserWarning: Matplotlib is currently using module://ipykernel.pylab.backend_inline, which is a non-GUI backend, so cannot show the figure.
  fig.show()<jupyter_text>ReglasDefinir las reglas para el sistema.<jupyter_code>quantity.deffuzify_method = "mon"
rules = []
rules.append(ctrl.Rule(temp["high"], quantity["high"]))
rules.append(ctrl.Rule(temp["medium"], quantity["medium"]))
rules.append(ctrl.Rule(temp["low"], quantity["low"]))<jupyter_output><empty_output><jupyter_text>SimulaciónSimular y graficar la salida del sistema para las siguientes temperaturas. - -10º - 0º - 10º - 14º - 20º - 33 º<jupyter_code>ctrSys = ctrl.ControlSystem(rules)
customers = ctrl.ControlSystemSimulation(ctrSys)
values = [-10, 0, 10, 14, 20, 33]
for value in values:
    customers.input["temp"] = value
    customers.compute()
    quantity.view(sim=customers)
    print(f"cantidad: {customers.output['quantity']}")<jupyter_output>G:\Anaconda\lib\site-packages\skfuzzy\control\fuzzyvariable.py:122: UserWarning: Matplotlib is currently using module://ipykernel.pylab.backend_inline, which is a non-GUI backend, so cannot show the figure.
  fig.show()
G:\Anaconda\lib\site-packages\skfuzzy\control\fuzzyvariable.py:122: UserWarning: Matplotlib is currently using module://ipykernel.pylab.backend_inline, which is a non-GUI backend, so cannot show the figure.
  fig.show()
G:\Anaconda\lib\site-packages\skfuzzy\control\fuzzyvariable.py:122: UserWarning: Matplotlib is currently using module://ipykernel.pylab.backend_inline, which is a non-GUI backend, so cannot show the figure.
  fig.show()
G:\Anaconda\lib\site-packages\skfuzzy\control\fuzzyvariable.py:122: UserWarning: Matplotlib is currently using module://ipykernel.pylab.backend_inline, which is a non-GUI backend, so cannot show the figure.
  fig.show()
G:\Anaconda\lib\site-packages\skfuzzy\control\fuzzyvariable.py:122: UserWarning: Matplotlib is currently using module://[...]
{'fraction_non_alphanumeric': 0.12091864969562811, 'fraction_numerical': 0.025179856115107913, 'mean_word_length': 5.965317919075145, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '515266', 'license': 'Apache-2.0', 'n_tokens_mistral': 1319, 'n_tokens_neox': 1232, 'n_words': 314, 'path': 'tp2/Ejercicio1.ipynb', 'repo_name': 'xRUIZxMATIASx/inteligencia-artificial', 'size': '3614'}