lundi 1 avril 2019

Logic Functions for Random Boolean Network

I am developing a very basic random boolean network.

A RBN consists of N nodes, which can take values of zero or one (Boolean). The state (zero or one) of each node is determined by K connections coming from other (or the same) nodes. The connections are wired randomly, but remain fixed during the dynamics of the network, i.e. “quenched”. The way in which nodes affect each other is not only determined by their connections, but by logic functions, which are generated randomly, simply using lookup tables for each node, which take the states of the connecting nodes as inputs, and the state of the node as output. These also remain fixed (quenched) during the dynamics of the network.

We had an idea to code the logic functions for each connection. Developed a binary tree for each node, read all the connections and randomly the root select which one to use (NOR, XOR, AND ... etc).

I am having a problem coding this piece because I cannot see how to add these nodes. I have thought of counting all de 1's and add in the tree.

Matrix(int vertex_num){
            srand(5);
            this->vertex_num = vertex_num;
            adjMatrix = new int*[vertex_num];
            /*QVector<QVector<int>> testMatrix;*/
            for (int i = 0; i < vertex_num; i++){
                adjMatrix[i] = new int[vertex_num];
                for (int j = 0; j < vertex_num; j++){
                    adjMatrix[i][j] = rand()%2;
                }
            }
       }

I would like to receive these connections, define a random function, and return a 0 or 1 after testing all the connections.




Aucun commentaire:

Enregistrer un commentaire