Beispiel #1
0
def valores_iniciales():
    cljapnn1 = CljaPNN(1, 1, ["vacio", "yogurB"], False, clja_hash_value=1)
    cljapnn2a = CljaPNN(1, 0, [], True, clja_hash_value=2)
    cljapnn2b = CljaPNN(1, 1, [], True, clja_hash_value=3)
    cljapnn3 = CljaPNN(1, 0, [], True, clja_hash_value=4)

    arbol_ftc = {cljapnn1: {0: None, 1: {cljapnn2a: {0: None}}}}

    arbol_ftc_plus = {
        cljapnn1: {
            0: None,
            1: {
                cljapnn2b: {
                    0: None,
                    1: {
                        cljapnn3: {
                            0: None
                        }
                    }
                }
            }
        }
    }

    clja_ftc1 = CljaFtc(arbol_ftc)
    clja_ftc_plus = CljaFtc(arbol_ftc_plus)
Beispiel #2
0
 def setupClass(self):
     # Do the real setup
     TestCase.setUp(self)
     print("Ejecutando tests de TestCaminoFinito.")
     """
     you want to have persistent things to test
     self.__class__.myclass = MyClass()
     (you can call this later with self.myclass)
     """
     self.__class__.clja_de_pruebas = CljaPNN(2, 0)
     self.__class__.cadena1 = "{1,2,3}"
     self.__class__.lista1 = [4, 19, 23]
Beispiel #3
0
    lista_de_caminos_003 = [cf1b, cf2b]
    lista_de_caminos_004 = [cf1c, cf2c]

    clja_ftc1 = CljaFtc(arbol_ftc)
    valor = clja_ftc1.flja_absoluta(1, lista_de_caminos_004)
    print(valor)

    mostrar_un_resultado_inverso(clja_ftc1, 98253443662)

    # valor = 8646728181026489602610406537158318670928372786737024641130379069394221138489756289944296330853769250295319449839701747788578674704953281144479843995473538301610130630818396456618570491270235271553
    mostrar_un_resultado_inverso(clja_ftc1,477288575441668738432294713119626675675569241613159952783185439580411090350769658392112879389265614198782965452411521307616865092560705943624260525071725451188772615676309079305202590059873569621342083958688801767147184051649126108593853606938219268851734157413188505948208240233449399479986485112917648790112466322347995459991621836163820468115529299745912598945573079140079985634817847709935532426800789214002177655356497863229795160162627031741487154384288186805406381379682762503007603845052410558777995028061890489440765096654198608680701257535261150673665412573775953732809509438302954337919917199139391926356379800502773715608651017834046926058275593099220690737602697814687471300508157383963240005210795984429582155888754850507404151476569112931149650580062784848452815811633575375387236099832358151965945163117580589532684179669821131402914328352818)

    mostrar_un_resultado_inverso(clja_ftc1, 0)
    mostrar_un_resultado_inverso(clja_ftc1, 1)
    """
    cljapnn5 = CljaPNN(1, 1, ["vacio", "yogurB"], False, clja_hash_value=1)
    cljapnn6 = CljaPNN(1, 0, [], True, clja_hash_value=2)

    arbol_ftc3 = {cljapnn5: {0: None, 1: {cljapnn6: {0: None}}}}
    clja_ftc3 = CljaFtc(arbol_ftc3)
    """
    for i in range(
            10000000000000000000000000000000000000000000000000000000999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999900,
            10000000000000000000000000000000000000000000000000000000999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999910
    ):
        mostrar_un_resultado_inverso(clja_ftc3, i)


    mostrar_un_resultado_inverso(
        clja_ftc3,
        94156575587063183742435118315579149471380793840065132386133229965706408344308742188076067173991980963734344843602542492492998733764974139124385427589333130574390189335609961929951172276418003667983621066182773333071788882179737534696170926299625783877309115862948377302724868823168846346203293488280503785727351841570559813554000175726921795112545384876067307742434932988652209506287432727296983782965079732443976951657553516679493868412023854572114156984073577823073904968655526601779962125814264512791317326279624587175334152470828961774563005485456324230728588302217034298049790945880343809630622
Beispiel #4
0
#     plt.rc('lines', linewidth = 2)  # A partir de aquí todas las líneas que dibujemos irán con ancho doble
#     plt.rc('font', size=18)  # A partir de aquí las fuentes que aparezcan en cualquier gráfico en la misma sesión tendrán mayor tamaño
#
#
#     # ------------------------------------------------------
#     # VENTANA CON PROPIEDADES MODIFICADAS
#     # # -----------------------------------------------------
#     # plt.figure('valores modificados')  # Creamos una ventana donde dibujamos el gráfico con la configuración por defecto
#     # plt.suptitle('Titulo valores modificados')  # Esto sirve para poner título dentro de la ventana
#     # plt.plot((1,2,3,4,5), label = u'linea más ancha y letra más grande')  # Hacemos el plot
#     # plt.legend(loc = 2)  # Colocamos la leyenda en la esquina superior izquierda
#
#     plt.show()

if __name__ == '__main__':
    cljapnn1 = CljaPNN(1, 1, ["vacio", "yogurB"], False, clja_hash_value=1)
    cljapnn2a = CljaPNN(1, 0, [], True, clja_hash_value=2)
    cljapnn2b = CljaPNN(1, 1, [], True, clja_hash_value=3)
    cljapnn3 = CljaPNN(1, 0, [], True, clja_hash_value=4)

    arbol_ftc = {cljapnn1: {0: None, 1: {cljapnn2a: {0: None}}}}

    arbol_ftc_plus = {
        cljapnn1: {
            0: None,
            1: {
                cljapnn2b: {
                    0: None,
                    1: {
                        cljapnn3: {
                            0: None
Beispiel #5
0
    for w_actual in range(1, clja.L + 1):
        resultados_ws.append(clja.flja(w_actual, camino))
    return resultados_ws


def imprimir_resultados_de_camino(clja, cf):
    cadena = "Camino: " + str(cf) + " -> " + str(todos_los_w(clja, cf))
    return cadena


# *********************************************************************************************************************
# MAIN:
# *********************************************************************************************************************

#clja_ftc = CljaFtc()
cljapnn1 = CljaPNN(ele=2, hr=0, previos=["vacio", "yogurB"], compuesta=False)
cljapnn2 = CljaPNN(ele=2, hr=1, previos=["vacio", "yogurB"], compuesta=False)

w = 1
print(informacion_clja(cljapnn1, "CLJAPNN1: "))
print(informacion_clja(cljapnn2, "CLJAPNN2: "))

print(
    "\nNIVEL 1: ****************************************************************************************************"
)
print("CLJAPNN1: " +
      imprimir_resultados_de_camino(cljapnn1, CaminoFinito("{0}")))
print("CLJAPNN2: " +
      imprimir_resultados_de_camino(cljapnn2, CaminoFinito("{0}", dr=1)))
print("CLJAPNN2: " +
      imprimir_resultados_de_camino(cljapnn2, CaminoFinito("{0}", dr=0)) +
Beispiel #6
0
 def __hash__(self):
     from source.cljas.CljaPNN import CljaPNN
     aux = CljaPNN(ele=1, hr=0, previos=[], compuesta=False, dr=self.dr)
     resultado = aux.flja(1, self)
     return resultado