pyphi.compositional_state.CompositionalState#
- class pyphi.compositional_state.CompositionalState(distinctions=None)[source]#
Bases:
UserDictRepresent assignments of purviews to mechanisms.
Has the following structure:
{ <purview>: { Direction.CAUSE: {<mechanism>}, Direction.EFFECT: {<mechanism>}, } }
where {<mechanism>} is a set of mechanisms. To represent a valid compositional state, this set must be a singleton; however, the class can be used with multiple mechanisms per purview & direction to keep track of conflicts among the distinctions in a CauseEffectStructure.
- has_conflicts(purview=None, mechanism=None)[source]#
Return whether the CompositionalState has conflicts.
- conflicted_purviews()[source]#
Return the purviews that are conflicted (specified by >1 distinction).
- number_of_conflicts(mechanism)[source]#
Return the number of other mechanisms the given mechanism conflicts with.
- resolve_conflicts(func=None)[source]#
Greedily discard extra mechanisms to return a valid CompositionalState.
Mechanisms with the most conflicts are discarded first.
- conflicts_with(mechanism, cause_purview, effect_purview)[source]#
Return whether the distinction conflicts with this CompositionalState.
- resolve_conflicts_consistently(other)[source]#
Greedily resolve conflicts in this CompositionalState in a manner consistent with the other one.