ajustes + debug

This commit is contained in:
Oscar Suescun Elizalde 2025-03-26 17:15:07 +01:00
parent ffef95e977
commit 4db7ca0186

View File

@ -52,7 +52,7 @@ def logica_offset(offset, error, errorObjetivo):
limSup = 1 + errorObjetivo
limInf = 1 - errorObjetivo
delta = random.random()/100
delta = random.random()/10000000
if error <= limSup and error >= limInf: return True, None
@ -66,6 +66,13 @@ def logica_offset(offset, error, errorObjetivo):
if __name__ == '__main__':
'''
Esto solo se activa si se lanza este script en concreto
no si se invocan las funciones.
Contiene ejemplos de como funciona el codigo
'''
directorio = ''
nombre = "curva.mdb"
@ -73,3 +80,26 @@ if __name__ == '__main__':
generar_curva(1,ruta)
offset = 0
E = 1
EObjetivo = 1.4
errorObjetivo = 0.1
flag = False
while flag == False:
os.system('cls')
E = E + offset
error = E/EObjetivo
print(E)
print(error)
flag, offset = logica_offset(offset, error, errorObjetivo)