Commit d63b7646 by alejandro77palacios

Función: calcular respuestas asociadas a un grupo de estímulos

parent de2f6314
......@@ -15,3 +15,12 @@ def extraer_particion(red, particion):
if len(nodos_en_particion) == 0:
raise ValueError(f'No hay nodos en la partición "{particion}"')
return nodos_en_particion
def obtener_respuestas_asociadas(red, *estimulos):
estimulos_validos = extraer_particion(red, 'estimulo')
assert set(estimulos).issubset(estimulos_validos), f'Las palabras estímulo válidas son:\n{estimulos_validos}'
respuestas_asociadas = []
for estimulo in estimulos:
respuestas_asociadas += list(red.neighbors(estimulo))
return respuestas_asociadas
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment