From 8a7f97f53aa8c78370c4b85fa174414cecd09702 Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Tue, 21 Dec 2021 15:13:15 +0100 Subject: [PATCH] WIP: Cas des espaces de taille constante: string. --- src/__pycache__/model.cpython-39.pyc | Bin 18957 -> 18922 bytes src/space.py | 22 +++++++++++----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/__pycache__/model.cpython-39.pyc b/src/__pycache__/model.cpython-39.pyc index 3da8ddf389520e72f9e2f92ea86a5990fc012ac4..6de209438b0d052223150cf68cc1752c43051001 100644 GIT binary patch delta 168 zcmeC3!uV=3BVQsfFBbz4ym)&c@r=$!zQfLw-^)r*mT_6jcy#h9mukinligga7*9_= z=$bWoy&4;PaYf|iPW9jy w1*s}J3?hzzh@&9l#N-1K5|gKUh%howUgPnAsc0WiKz#CQPb*d{7Dg5(0K-Z{-2eap diff --git a/src/space.py b/src/space.py index 6773dd1..c4f53aa 100644 --- a/src/space.py +++ b/src/space.py @@ -6,10 +6,10 @@ sites = int(model.testmodel.get_parameters().spaceparam.get_site_multiplicity()) nb_arrows = int(model.testmodel.get_states().get_space(0).get_nb_arrows()) -print("\nspace size = ", size, " nb de sites par cellule = ", sites, - " nb total de flèches dans l'espace = ", nb_arrows) +print("\nspace size =", size, " nb de sites par cellule =", sites, + " nb total de flèches dans l'espace =", nb_arrows, end='\n') -print(' | ', end=' ') +view = ' | ' # TODO Contrôles de cohérence des données # condition et arrow @@ -31,19 +31,19 @@ for n in range(0, size + 1): ): arr = sp.get_arrow(a).get_weight() if arr > 0: - print(str(arr), end=' ') + view += str(arr) + ' ' else: - print('.', end=' ') + view += '. ' - print(' | ', end=' ') - -print('\n ' + ' ' * sites * 2, end='') + view += ' | ' +coord = ' ' * sites + ' ' for k in range(0, size + 1): if k < 9: - print(k + 1, end=' ' + ' ' * sites * 2) + coord += str(k + 1) + ' ' + ' ' * sites * 2 else: - print(k + 1, end=' ' + ' ' * sites * 2) + coord += str(k + 1) + ' ' + ' ' * sites * 2 -print('\n', end="") +print(view) +print(coord)