js/motifFinder/broadcastGatherFinder.js
/**
 * @classdesc
 * 
 * <p>
 * This class is responsible for finding broadcast or gather motif.
 * </p>
 * 
 * <p>
 * Intuitively, a broadcast motif is a communication pattern where a host sends
 * messages to other hosts in quick succession. A gather motif then is where
 * multiple hosts send messages to a single one in quick succession.
 * </p>
 * 
 * <p>
 * More formally, a broadcast motif is sequence S of k nodes n_1, n_2, n_3 ...
 * n_k
 * <ul>
 * <li>S is a sequence of consecutive nodes</li>
 * <li>No nodes in S except n_1 may have any parents. n_1 can have any number
 * of parents.</li>
 * <li>Each node in T is the child of a node in S</li>
 * <li>Define valid-parent as follows: a node n_i is a valid-parent if it is a
 * parent of a node n_c such that n_c's host is not equal to the host of any of
 * the children of nodes n_1 to n_(i-1) inclusive.
 * <li>For all nodes n_i in S that are valid-parents let n_j be the node in S
 * with the smallest j such that j > i that is also a valid-parent. The number
 * of nodes between n_i and n_j must be less than or equal to the parameter
 * maxInBetween</li>
 * <li>Let Hosts be the set of hosts of all nodes in the set of nodes that are
 * a child of a node in S. The cardinality of Hosts must be greater than or
 * equal to the parameter minBroadcastGather.
 * </ul>
 * </p>
 * 
 * <p>
 * The actual motif itself comprises all nodes in S and all nodes that are
 * children of a node in S. It also contains all edges that connect any two
 * nodes in S and all edges that connect any node in S its children.
 * </p>
 * 
 * <p>
 * The formal definition of a gather motif is analogous to broadcast. In the
 * formal definition above, replace child(ren) with parent(s) and parent(s) with
 * child(ren). One difference for gather is that no nodes in S INCLUDING n_1 may
 * have any parents.
 * </p>
 * 
 * @constructor
 * @extends MotifFinder
 * @param {int} minBroadcastGather Minimum amount of broadcasts or gathers
 *            needed to accept a motif
 * @param {int} maxInBetween Maximum number of non-broadcasting or gathering
 *            nodes allowed since previous broadcasting or gathering one. This
 *            number includes the last broadcasting or gathering node itself.
 *            For example, if you set this to 1, the finder will allow ZERO
 *            nodes between broadcast/gather nodes (in other words, ONE node
 *            since the previous broadcast/gather node including that one)
 * @param {Boolean} broadcast Set to true to find broadcasts. Set to false to
 *            find gathers
 */
@classdesc


This class is responsible for finding broadcast or gather motif.


Intuitively, a broadcast motif is a communication pattern where a host sends
messages to other hosts in quick succession. A gather motif then is where
multiple hosts send messages to a single one in quick succession.


More formally, a broadcast motif is sequence S of k nodes n_1, n_2, n_3
n_k

S is a sequence of consecutive nodes
No nodes in S except n_1 may have any parents. n_1 can have any number
of parents.
Each node in T is the child of a node in S
Define valid-parent as follows: a node n_i is a valid-parent if it is a
parent of a node n_c such that n_c's host is not equal to the host of any of
the children of nodes n_1 to n_(i-1) inclusive.
For all nodes n_i in S that are valid-parents let n_j be the node in S
with the smallest j such that j > i that is also a valid-parent. The number
of nodes between n_i and n_j must be less than or equal to the parameter
maxInBetween
Let Hosts be the set of hosts of all nodes in the set of nodes that are
a child of a node in S. The cardinality of Hosts must be greater than or
equal to the parameter minBroadcastGather.


The actual motif itself comprises all nodes in S and all nodes that are
children of a node in S. It also contains all edges that connect any two
nodes in S and all edges that connect any node in S its children.


The formal definition of a gather motif is analogous to broadcast.

@constructor
@extends MotifFinder
@param {int} minBroadcastGather Minimum amount of broadcasts or gathers
needed to accept a motif
@param {int} maxInBetween Maximum number of non-broadcasting or gathering
nodes allowed since previous broadcasting or gathering one. This
number includes the last broadcasting or gathering node itself.
For example, if you set this to 1, the finder will allow ZERO
nodes between broadcast/gather nodes (in other words, ONE node
since the previous broadcast/gather node including that one)
@param {Boolean} broadcast Set to true to find broadcasts. Set to false to
find gathers
@classdesc This class is responsible for finding broadcast or gather motif . Intuitively a broadcast motif is a communication pattern where a host sends messages to other hosts in quick succession . A gather motif then is where multiple hosts send messages to a single one in quick succession . More formally a broadcast motif is sequence S of k nodes n_1 n_2 n_3 n_k S is a sequence of consecutive nodes No nodes in S except n_1 may have any parents . n_1 can have any number of parents . Each node in T is the child of a node in S Define valid - parent as follows : a node n_i is a valid - parent if it is a parent of a node n_c such that n_c ' s host is not equal to the host of any of the children of nodes n_1 to n_ ( i - 1 ) inclusive . For all nodes n_i in S that are valid - parents let n_j be the node in S with the smallest j such that j > i that is also a valid - parent . The number of nodes between n_i and n_j must be less than or equal to the parameter maxInBetween Let Hosts be the set of hosts of all nodes in the set of nodes that are a child of a node in S . The cardinality of Hosts must be greater than or equal to the parameter minBroadcastGather . The actual motif itself comprises all nodes in S and all nodes that are children of a node in S . It also contains all edges that connect any two nodes in S and all edges that connect any node in S its children . The formal definition of a gather motif is analogous to broadcast . @constructor @extends MotifFinder @param { int } minBroadcastGather Minimum amount of broadcasts or gathers needed to accept a motif @param { int } maxInBetween Maximum number of non - broadcasting or gathering nodes allowed since previous broadcasting or gathering one . This number includes the last broadcasting or gathering node itself . For example if you set this to 1 the finder will allow ZERO nodes between broadcast / gather nodes ( in other words ONE node since the previous broadcast / gather node including that one ) @param { Boolean } broadcast Set to true to find broadcasts . Set to false to find gathers
function BroadcastGatherFinder(minBroadcastGather, maxInBetween, broadcast) {
    this.minBroadcastGather = minBroadcastGather;
    this.maxInBetween = maxInBetween;
    this.broadcast = broadcast;
}
function BroadcastGatherFinder ( minBroadcastGather , maxInBetween , broadcast ) { this . minBroadcastGather = minBroadcastGather ; this . maxInBetween = maxInBetween ; this . broadcast = broadcast ; }
@classdesc
@classdesc
/** @private */ /** @private */ /** @private */