X-Git-Url: https://git.llucax.com/z.facultad/75.68/celdas.git/blobdiff_plain/38252dfa17d6be81f176feceb8b4fbe612a9b597..651df9d4bd2ec484ec71c80d7dd2165d7cf4290e:/trunk/src/SistemaAutonomo.tz diff --git a/trunk/src/SistemaAutonomo.tz b/trunk/src/SistemaAutonomo.tz index b7c3cc7..e301d6d 100644 --- a/trunk/src/SistemaAutonomo.tz +++ b/trunk/src/SistemaAutonomo.tz @@ -1,84 +1,84 @@ - -@plugin "plugin.so" (SAbrFunctions). - -Object : Teoria (aka Teorias) { - - + variables: - ptr (pointer). - - + to init named name (string) with-action action (string) - executed k = 1 (int) succeeded p = 1 (int): - ptr = TeoriaNew(name, action, k, p). - - + to set-dato-inicial name theName (string) value theValue (float): - TeoriaSetDatoInicial(ptr, theName, theValue). - - + to set-dato-final name theName (string) value theValue (float): - TeoriaSetDatoFinal(ptr, theName, theValue). - - + to get-nombre: - return TeoriaGetNombre(ptr). - - + to get-accion: - return TeoriaGetAccion(ptr). - - - to get-ptr: - return ptr. - - - to set-ptr ptr p (pointer): - ptr = p. - - + to destroy: - TeoriaDelete(ptr). -} - -Object : SistemaAutonomo { - - + variables: - ptr (pointer). - - + to init: - ptr = SistemaAutonomoNew(). - - + to add teoria theTeoria (object): - SistemaAutonomoAddTeoria(ptr, (theTeoria get-ptr)). - - + to set-entorno value theValue (float) with-name theName (string): - SistemaAutonomoSetValue(ptr, theName, theValue). - - + to set-dato-final value theValue (float) with-name theName (string): - SistemaAutonomoSetDatoFinal(ptr, theName, theValue). - - + to update-entorno entorno theEntorno (hash): - nombre (string). - foreach nombre in keys(theEntorno): { - print "Seteando valor de entorno ", nombre, " con ", theEntorno{nombre}. - self set-entorno value theEntorno{nombre} with-name nombre. - } - - + to update-datos-finales datos-finales datos (hash): - nombre (string). - foreach nombre in keys(datos): { - print "Seteando valor de dato final ", nombre, " con ", datos{nombre}. - self set-dato-final value datos{nombre} with-name nombre. - } - - + to plan: - SistemaAutonomoPlan(ptr). - - + to has-next-theory: - return SistemaAutonomoHasNextTheory(ptr). - - + to get-next-theory: - t (object). - t = new Teoria. - t set-ptr ptr SistemaAutonomoGetNextTheory(ptr). - return t. - - + to validate theory theTheory (object): - return SistemaAutonomoValidateTheory(ptr, (theTheory get-ptr)). - - + to destroy: - SistemaAutonomoDelete(ptr). -} - + +@plugin "plugin.so" (SAbrFunctions). + +@define ANY -3000000. + +Object : Teoria (aka Teorias) { + + + variables: + ptr (pointer). + + + to init named name (string) with-action action (string) + executed k = 1 (int) succeeded p = 1 (int): + ptr = TeoriaNew(name, action, k, p). + + + to set-dato-inicial name theName (string) value theValue (float): + TeoriaSetDatoInicial(ptr, theName, theValue). + + + to set-dato-final name theName (string) value theValue (float): + TeoriaSetDatoFinal(ptr, theName, theValue). + + + to get-nombre: + return TeoriaGetNombre(ptr). + + + to get-accion: + return TeoriaGetAccion(ptr). + + - to get-ptr: + return ptr. + + - to set-ptr ptr p (pointer): + ptr = p. + + + to destroy: + TeoriaDelete(ptr). +} + +Object : SistemaAutonomo { + + + variables: + ptr (pointer). + + + to init: + ptr = SistemaAutonomoNew(). + + + to add teoria theTeoria (object): + SistemaAutonomoAddTeoria(ptr, (theTeoria get-ptr)). + + + to set-entorno value theValue (float) with-name theName (string): + SistemaAutonomoSetValue(ptr, theName, theValue). + + + to set-dato-final value theValue (float) with-name theName (string): + SistemaAutonomoSetDatoFinal(ptr, theName, theValue). + + + to update-entorno entorno theEntorno (hash): + nombre (string). + foreach nombre in keys(theEntorno): { + self set-entorno value theEntorno{nombre} with-name nombre. + } + + + to update-datos-finales datos-finales datos (hash): + nombre (string). + foreach nombre in keys(datos): { + self set-dato-final value datos{nombre} with-name nombre. + } + + + to plan: + SistemaAutonomoPlan(ptr). + + + to has-next-theory: + return SistemaAutonomoHasNextTheory(ptr). + + + to get-next-theory: + t (object). + t = new Teoria. + t set-ptr ptr SistemaAutonomoGetNextTheory(ptr). + return t. + + + to validate theory theTheory (object): + return SistemaAutonomoValidateTheory(ptr, (theTheory get-ptr)). + + + to destroy: + SistemaAutonomoDelete(ptr). +} +