Skip to main content

Diagramming tools for the Thinking Processes from the Theory of Constraints

Project description

Thinking Processes

This Python package helps you to draw diagrams used in the Thinking Processes from the Theory of Constraints. For more information, see https://en.wikipedia.org/wiki/Thinking_processes_(theory_of_constraints)

Prerequisites

Python 3.11+

Installing

pip install thinking-processes

Current Reality Tree

In this example, we find root causes for undesired effects by drawing a Current Reality Tree:

from thinking_processes import CurrentRealityTree

crt = CurrentRealityTree()
        
engine_not_start = crt.add_node("Car's engine will not start")
engine_needs_fuel = crt.add_node('Engine needs fuel in order to run')
no_fuel_to_engine = crt.add_node('Fuel is not getting to the engine')
water_in_fuel_line = crt.add_node('There is water in the fuel line')
crt.add_causal_relation([engine_needs_fuel, no_fuel_to_engine], engine_not_start)
crt.add_causal_relation([water_in_fuel_line], no_fuel_to_engine)

air_conditioning_not_working = crt.add_node('Air conditioning is not working')
air_not_circulating = crt.add_node('Air is not able to circulate')
air_intake_full_of_water = crt.add_node('The air intake is full of water')
crt.add_causal_relation([air_not_circulating], air_conditioning_not_working)
crt.add_causal_relation([air_intake_full_of_water], air_not_circulating)

radio_distorted = crt.add_node('Radio sounds distorted')
speakers_obstructed = crt.add_node('The speakers are obstructed')
speakers_underwater = crt.add_node('The speakers are underwater')
crt.add_causal_relation([speakers_obstructed], radio_distorted)
crt.add_causal_relation([speakers_underwater], speakers_obstructed)

car_in_pool = crt.add_node('The car is in the swimming pool')
crt.add_causal_relation([car_in_pool], speakers_underwater)
crt.add_causal_relation([car_in_pool], air_intake_full_of_water)
crt.add_causal_relation([car_in_pool], water_in_fuel_line)

handbreak_faulty = crt.add_node('The handbreak is faulty')
handbreak_stops_car = crt.add_node('The handbreak stops the car from rolling into the swimming pool')
crt.add_causal_relation([handbreak_faulty, handbreak_stops_car], car_in_pool)

crt.plot(view=True, filepath='crt.png')

The resulting tree looks like this:

Current Reality Tree

Evaporating Cloud (Conflict Resolution Diagram)

In this example, we resolve a conflict by identifying wrong assumptions behind the conflict:

from thinking_processes import EvaporatingCloud

ec = EvaporatingCloud(
    objective='Reduce cost per unit',
    need_a='Reduce setup cost per unit',
    need_b='Reduce carrying cost per unit',
    conflict_part_a='Run larger batches',
    conflict_part_b='Run smaller batches'
)

ec.add_assumption_on_the_conflict('small is the opposite of large', is_true=True)
ec.add_assumption_on_the_conflict('there is only one meaning to the word "batch"', is_true=False)
ec.add_assumption_on_need_a("setup cost is fixed and can't be reduced")
ec.add_assumption_on_need_a("the machine being set up is a bottleneck with no spare capacity")
ec.add_assumption_on_need_b("smaller batches reduce carrying cost")

ec.plot(view=True, filepath='ec.png')

The resulting diagram looks like this:

Evaporating Cloud

Future Reality Tree

In this example, we introduce injections to achieve desired effects:

from thinking_processes import FutureRealityTree
frt = FutureRealityTree()
        
engine_starts = frt.add_desirable_effect("Car's engine will start")

build_fence = frt.add_injection("Build a fence between road and pool")
frt.add_negative_effect(build_fence, 'Car can roll into the fence')

cannot_roll_into_pool = frt.add_intermediate_effect("Car parked at the road does not roll into the pool")
no_water_in_fuel_line = frt.add_intermediate_effect("There is no water in the fuel line")
fuel_to_the_engine = frt.add_intermediate_effect("Fuel is getting to the engine")

frt.add_causal_relation([build_fence], cannot_roll_into_pool)
frt.add_causal_relation([cannot_roll_into_pool], no_water_in_fuel_line)
frt.add_causal_relation([no_water_in_fuel_line], fuel_to_the_engine)
frt.add_causal_relation([fuel_to_the_engine], engine_starts)

airintake = frt.add_intermediate_effect("Air intake is free of water")
air_circulation = frt.add_intermediate_effect("Air is able to circulate")
ac_working = frt.add_desirable_effect("Air conditioning is working")
frt.add_causal_relation([cannot_roll_into_pool], airintake)
frt.add_causal_relation([airintake], air_circulation)
frt.add_causal_relation([air_circulation], ac_working)

radio_sounds_good = frt.add_desirable_effect("Radio sounds good")
speakers_not_underwater = frt.add_intermediate_effect("Speakers are not underwater")
frt.add_causal_relation([cannot_roll_into_pool], speakers_not_underwater)
frt.add_causal_relation([speakers_not_underwater], radio_sounds_good)

frt.plot(view=True, filepath='frt.png')

The resulting diagram looks like this:

Future Reality Tree

Development

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Running the tests

All tests in the "tests" directory are based on the unittest package.

Deployment

make rm -R dist build thinking_processes.egg-info || python -m build && twine upload --skip-existing --verbose dist/*

You should also create a tag for the current version

git tag -a [version] -m "describe what has changed"
git push --tags

Versioning

We use SemVer for versioning.

Authors

If you have any questions, feel free to ask one of our authors:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

thinking_processes-0.0.3.tar.gz (45.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

thinking_processes-0.0.3-py3-none-any.whl (38.8 kB view details)

Uploaded Python 3

File details

Details for the file thinking_processes-0.0.3.tar.gz.

File metadata

  • Download URL: thinking_processes-0.0.3.tar.gz
  • Upload date:
  • Size: 45.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.3

File hashes

Hashes for thinking_processes-0.0.3.tar.gz
Algorithm Hash digest
SHA256 ae7db8df0919ed241f1993bc429f3aedf612b3fbe733dd4ebadaab7f954883fc
MD5 e2fa11bfb6260f51fac0156d20bf768c
BLAKE2b-256 c7f2c8d0d2164d7fc44f017b80ea3360deb8a944803e2d8984ad63a6c993b436

See more details on using hashes here.

File details

Details for the file thinking_processes-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for thinking_processes-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 90697797f8f5cd8b37fa588bc77cf975fd1b14da2d49e57b6d8a0b0415b375ca
MD5 cf399a6608b072dfafc51b20b1e40cc2
BLAKE2b-256 93234c8621f4af17cc8a8145dfde2ecdd6a297b8d7be15bf7176829d3d1df88c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page