Closed stas-g closed 1 year ago
Actually, the attractors are being computed correctly. The output of attractors()
is not the decimal version of the binary representing the state of the network. Rather, it is the key into the nodes of the networkx graph of the STG (L._stg.nodes[3] = {"label": "111"}
).
It just so happens that, for N
, the keys match the network state they map to.
You can obtain the network states from those dictionary indicies like this:
>>> [set(L._stg.nodes[nid]["label"] for nid in att) for att in L.attractors()]
[{'111'}]
>>> [set(N._stg.nodes[nid]["label"] for nid in att) for att in N.attractors()]
[{'000'}, {'111'}]
Hope this helps!
@austin-marcus thank you for your help!
as per the title, i get wrong attractors with any constants in the network. consider two simple networks, L and N, respectively:
and
read in:
now, L has only one attractor, "111", whilst N has two, "111" and "000". however
to get the correct (kind of, assuming value of 1 is implied for x) attractor for L, one needs to account for constants:
one can get the correct trajectory to an attractor though + correct attractor: