Skip to content

fabid/cldx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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'}]

About

Causal Loop Diagrams with networkx

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages