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.

undoKnockouts()

Undoes all knockouts and knockdowns.

update_cumulative_probabilities()

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

buildK()[source]

This rebuilds the K array and related attributes.

copy() ProbabilisticBN[source]

Create a deep copy of the PBN. Required for optimization to avoid modifying original network.

getBias()[source]
getMaxConnectivity()[source]
getMeanConnectivity()[source]
getRealization()[source]
getTrajectory()[source]
initializeOutput()[source]
knockdown(key, value, efficacy=1.0)[source]

Sets a specific node with partial efficacy for experimental perturbation.

knockout(key, value)[source]

Sets a specific node to be permanently fixed to a given value.

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.

stateToWrite()[source]
undoKnockouts()[source]

Undoes all knockouts and knockdowns. Does not change initial values, however.

update(iterations=1)[source]
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).

writeNetworkHistory()[source]