booldog.network
Defines booldog.network.BoolDogModel, the central class of the package.
BoolDogModel carries almost no logic of its own: it is a composition of mixins (Boolean-network operations, structural modifications, continuous/ODE simulation, and I/O), each implemented in its own subpackage. This module only owns __init__, node/index bookkeeping, and the primes property.
Attributes
Classes
A class to represent a Boolean network. |
Module Contents
- booldog.network.logger
- class booldog.network.BoolDogModel(nodes=None, primes=None, modelinfo=None)
Bases:
booldog.boolean.BooleanNetworkMixin,booldog.boolean.BooleanNetworkModificationMixin,booldog.continuous.ContinuousMixin,booldog.io.BoolDogModelIOFromMixin,booldog.io.BoolDogModelIOToMixinA class to represent a Boolean network.
This class is a composition of mixins: booldog.boolean.BooleanNetworkMixin (read-only Boolean-network operations), booldog.boolean.BooleanNetworkModificationMixin (structural edits), booldog.continuous.ContinuousMixin (ODE-based continuous simulation), and booldog.io.BoolDogModelIOFromMixin/booldog.io.BoolDogModelIOToMixin (reading/writing various network exchange formats). This class (network.py) itself only defines __init__, node/index bookkeeping, and the primes property.
- nodes
the network’s nodes, keyed by identifier.
- Type:
dict of str to BoolDogNode
- _primes_cached = True
- modelinfo
model metadata; a default instance if modelinfo was not provided.
- Type:
- modifications = []
audit trail of structural modifications (see booldog.boolean.modifications.Modification) applied to this network via add_node/remove_node(s)/update_node/modify_network.
- Type:
list of Modification
- _set_node_ids_and_index()
Set the sorted node identifiers and index mapping to integers.
Called on initialisation, and again after any structural modification (see booldog.boolean.modifications.BooleanNetworkModificationMixin._update_model_object) to keep node_ids/index consistent with self.nodes.
- property n
Number of nodes in the network
- property primes
Prime implicants of the Boolean network. See PyBoolNet:prime implicants for more information.
- __repr__()
String representation of the model, showing its class and node count.
- __len__()
Number of nodes in the network (same as
n).