Class: ListenerObserverPGM

ListenerObserverPGM

The ListenerObserverPGM is a wrapper that combines both listenerBeliefPGM and ListenerPGM.

Constructor

new ListenerObserverPGM(divID, listenerBeliefConfig, listenerConfig, adjMatConfig, cMat, speakerLayerProbabilityDistribution, changeNodeRadiusBasedOnDistribution)

Create a ListenerObserverPGM with uniform weight distribution by default.
Parameters:
Name Type Description
divID string The id of the html tag that contains this pgm, it is of the form '#id_name'.
listenerBeliefConfig object Listener's belief pgm configuration.
listenerConfig object ListenerPGM's configuration.
adjMatConfig object Weighted adjacency matrix configuration.
cMat array The label cluster matrix holds the labels. Ex of cluster mat [layer1_label_array, layer2_label_array, layer3_label_array] where each layer_label_array holds an array of labelrs in one layer.
speakerLayerProbabilityDistribution array The probability distribution of the speaker layer nodes.
changeNodeRadiusBasedOnDistribution boolean Change speaker layer nodes radius based on the probability distribution.
Source:

Methods

setEdgeWeights(vertexId, edges) → {object}

Set the adjacency edges for a vertex by id.
Parameters:
Name Type Description
vertexId number The id or the index of the vertex in the data array of the graphData.
edges object The object contains the adjacency edges of a vertex and their weights. return this pgm to allow setEdgeWeights to be stacked.
Source:
Returns:
This grpahicalModel object.
Type
object
Example
// Create three directed edges 0->3, 0->4, 0->5 with edge weiths 0.8, 0.1 and 0.1
listenerObserverPGM.setEdgeWeights(0, [{
            id: 3,
            weight: 0.8
        }, {
            id: 4,
            weight: 0.1
        }, {
            id: 5,
            weight: 0.1
        }]);

setEdgeWeights(vertexId, edges) → {object}

Set the adjacency edges for a vertex by id.
Parameters:
Name Type Description
vertexId number The id or the index of the vertex in the data array of the graphData.
edges object The object contains the adjacency edges of a vertex and their weights. return this pgm to allow setEdgeWeights to be stacked.
Source:
Returns:
This grpahicalModel object.
Type
object
Example
// Create three directed edges 0->3, 0->4, 0->5 with edge weiths 0.8, 0.1 and 0.1
listenerObserverPGM.setEdgeWeights(0, [{
            id: 3,
            weight: 0.8
        }, {
            id: 4,
            weight: 0.1
        }, {
            id: 5,
            weight: 0.1
        }]);

ListenerObserverPGM

The ListenerObserverPGM is a wrapper that combines both listenerBeliefPGM and ListenerPGM.

Constructor

new ListenerObserverPGM(divID, listenerBeliefConfig, listenerConfig, adjMatConfig, cMat, speakerLayerProbabilityDistribution, changeNodeRadiusBasedOnDistribution)

Create a ListenerObserverPGM with uniform weight distribution by default.
Parameters:
Name Type Description
divID string The id of the html tag that contains this pgm, it is of the form '#id_name'.
listenerBeliefConfig object Listener's belief pgm configuration.
listenerConfig object ListenerPGM's configuration.
adjMatConfig object Weighted adjacency matrix configuration.
cMat array The label cluster matrix holds the labels. Ex of cluster mat [layer1_label_array, layer2_label_array, layer3_label_array] where each layer_label_array holds an array of labelrs in one layer.
speakerLayerProbabilityDistribution array The probability distribution of the speaker layer nodes.
changeNodeRadiusBasedOnDistribution boolean Change speaker layer nodes radius based on the probability distribution.
Source:

Methods

setEdgeWeights(vertexId, edges) → {object}

Set the adjacency edges for a vertex by id.
Parameters:
Name Type Description
vertexId number The id or the index of the vertex in the data array of the graphData.
edges object The object contains the adjacency edges of a vertex and their weights. return this pgm to allow setEdgeWeights to be stacked.
Source:
Returns:
This grpahicalModel object.
Type
object
Example
// Create three directed edges 0->3, 0->4, 0->5 with edge weiths 0.8, 0.1 and 0.1
listenerObserverPGM.setEdgeWeights(0, [{
            id: 3,
            weight: 0.8
        }, {
            id: 4,
            weight: 0.1
        }, {
            id: 5,
            weight: 0.1
        }]);

setEdgeWeights(vertexId, edges) → {object}

Set the adjacency edges for a vertex by id.
Parameters:
Name Type Description
vertexId number The id or the index of the vertex in the data array of the graphData.
edges object The object contains the adjacency edges of a vertex and their weights. return this pgm to allow setEdgeWeights to be stacked.
Source:
Returns:
This grpahicalModel object.
Type
object
Example
// Create three directed edges 0->3, 0->4, 0->5 with edge weiths 0.8, 0.1 and 0.1
listenerObserverPGM.setEdgeWeights(0, [{
            id: 3,
            weight: 0.8
        }, {
            id: 4,
            weight: 0.1
        }, {
            id: 5,
            weight: 0.1
        }]);