BNMPy.PBN¶
- class BNMPy.PBN.ProbabilisticBN(numberOfNodes, linkages, numberOfFunctions, functions, probabilities, initialNodeValues, outputFilePath='', nodeDict=None)[source]¶
Methods
buildK
()This rebuilds the K array and related attributes.
copy
()Create a deep copy of the PBN.
knockdown
(key, value[, efficacy])Sets a specific node with partial efficacy for experimental perturbation.
knockout
(key, value)Sets a specific node to be permanently fixed to a given value.
setInitialValue
(key, value)Sets a particular node to a given initial value, where the key is indexed in nodeDict.
setInitialValues
(initialNodeValues)Sets the initial values of the probabilistic boolean network.
Undoes all knockouts and knockdowns.
Update cumulative probabilities for each node's functions.
update_noise
(p[, iterations])Update the network with noise parameter p over a given number of iterations.
getBias
getMaxConnectivity
getMeanConnectivity
getRealization
getTrajectory
initializeOutput
stateToWrite
update
writeNetworkHistory
- copy() ProbabilisticBN [source]¶
Create a deep copy of the PBN. Required for optimization to avoid modifying original network.
- knockdown(key, value, efficacy=1.0)[source]¶
Sets a specific node with partial efficacy for experimental perturbation.
- setInitialValue(key, value)[source]¶
Sets a particular node to a given initial value, where the key is indexed in nodeDict.
- setInitialValues(initialNodeValues)[source]¶
Sets the initial values of the probabilistic boolean network.
- undoKnockouts()[source]¶
Undoes all knockouts and knockdowns. Does not change initial values, however.
- update_cumulative_probabilities()[source]¶
Update cumulative probabilities for each node’s functions. This is used for efficient function selection during simulation.
The method: 1. Validates probability distributions 2. Computes cumulative probabilities 3. Stores them for efficient sampling
- update_noise(p, iterations=1)[source]¶
Update the network with noise parameter p over a given number of iterations.
This method simulates the network’s evolution over time with added noise. Noise randomly flips node states with probability p after normal network update, but is never applied to constant nodes (knockouts).