From 0fd39664339ac5b5d0e68846fec8fa21653fc2af Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Thu, 9 Dec 2021 14:55:59 +0100 Subject: [PATCH] WIP : a first approach of space data strucures. --- models/dimers random walk.xml | 17 ++++++++++------- src/__pycache__/model.cpython-39.pyc | Bin 16531 -> 16531 bytes src/glimpse.py | 19 +++++++++++++++---- 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/models/dimers random walk.xml b/models/dimers random walk.xml index dd1a838..962989b 100644 --- a/models/dimers random walk.xml +++ b/models/dimers random walk.xml @@ -34,7 +34,7 @@ - 3 + 6 @@ -55,15 +55,18 @@ + - - - - - + + + + + + + + at locations (0,1) (6,7) and (15,16) --> diff --git a/src/__pycache__/model.cpython-39.pyc b/src/__pycache__/model.cpython-39.pyc index e10e626765e2487d13c11255397355de421fc765..9faf52415622d061c5346f9a38755ca0117c64f1 100644 GIT binary patch delta 21 bcmbQ-$T+!?kt>mxmx}=i*4)|1)#(5LJz)jL delta 21 bcmbQ-$T+!?kt>mxmx}=i6s~OK>U01AIq?ND diff --git a/src/glimpse.py b/src/glimpse.py index 1a1ce18..27b2053 100644 --- a/src/glimpse.py +++ b/src/glimpse.py @@ -5,30 +5,41 @@ sp = model.testmodel.get_states().get_space(0) size = model.testmodel.get_parameters().spaceparam.get_dimension().get_x() nb_sites = int (model.testmodel.get_parameters().spaceparam.get_site_multiplicity()) nb_arrows = int (model.testmodel.get_states().get_space(0).get_nb_arrows()) +weight = int (model.testmodel.get_states().get_space(0).get_arrow(0).get_weight()) space = [] cells = [] sites = [] +weights = [] arrows = [] +extremite = 1 for x in range (0, nb_arrows): arrows.append(sp.get_arrow(x).get_coord("x")) sites.append(sp.get_arrow(x).get_site()) + weights.append(sp.get_arrow(x).get_weight()) + +for i in range (0, (size + 1) * (nb_sites + 1) + extremite): space.append(0) print() -# print (sites) +print("space size = ", size, " nb de sites par cellule = ", nb_sites, + " nb total de flèches dans l'espace = ", nb_arrows) +print() +print (sites) +print (weights) print (arrows) print() for i in range (0, size + 1): cells.append('') -for i in range (0,121): space.append(0) for i in range (0, size + nb_sites - 1): - space[i * (nb_sites + 1)] = '' + if i <= size + extremite: # ad hoc ! (j'en conviens...) + space[i * (nb_sites + 1)] = '' for k in range (0, nb_arrows): if arrows[k] == i: cells[i] = i # cette cellule contient au moins une flèche - space[i * (nb_sites + 1) + sites[k] + 1] = 1 # nombre de flèches dans ce site + space[i * (nb_sites + 1) + sites[k] + 1] = weights[k] + # nombre de flèches dans ce site print (cells) print()