Skip to content
Causal Loop Diagrams with networkx
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cldx
.gitignore
LICENSE
README.md
example.png
setup.py

README.md

cldx

Causal Loop Diagrams with networkx

installation

python setup.py install

Usage

from cldx import CausalLoopDiagram

cld = CausalLoopDiagram()
cld = CausalLoopDiagram()
cld.add_causal_links([
    ('Birth rate of Lynx',"Lynx population", 1),
    ('Death rate of Lynx',"Lynx population", -1),
    ("Lynx population", "Food supply of Lynx", -1),
    ("Starvation of Lynx", "Death rate of Lynx", 1),
    ("Food supply of Lynx", "Starvation of Lynx", 1),
    ("Food supply of Lynx", "Birth rate of Lynx", 1),
    ])
cld.draw(loops=loops)

causal loop diagram

You can also find loops in the diagram:

>>> cld.find_loops()
[{'nodes': ['Birth rate of Lynx', 'Lynx population', 'Food supply of Lynx'],
  'type': 'S'},
 {'nodes': ['Lynx population',
   'Food supply of Lynx',
   'Starvation of Lynx',
   'Death rate of Lynx'],
  'type': 'R'}]
You can’t perform that action at this time.