ajustes + debug
This commit is contained in:
parent
ffef95e977
commit
4db7ca0186
32
genCurvas.py
32
genCurvas.py
@ -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)
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user