@ector/state
allows activation value propagation within a @ector/concept-network
.
const conceptNetwork = require('@ector/concept-network');
const cns = require('@ector/state');
let cn = conceptNetwork.addNode({}, 'ECTOR');
cn = conceptNetwork.addNode(cn, 'knows');
cn = conceptNetwork.addNode(cn, 'Achille');
cn = conceptNetwork.addLink(cn, 'ECTOR', 'knows');
cn = conceptNetwork.addLink(cn, 'knows', 'Achille');
let cns = cns.activate({}, 'ECTOR');
cns = cnsPropagate(cn, cns);
will give
{ "ECTOR": { "value": 59.500004166625004, "age": 1, "old": 100 },
"knows": { "value": 63.40844023393148, "age": 0, "old": 0 } }
- ConceptNetworkState
- ConceptNetworkNodeState
- activate
- getActivationValue
- getOldActivationValue
- getMaxActivationValue
- getActivatedTypedNodes
- setActivationValue
- propagate
- mapObjIndexed
- influenceNb
- influenceValue
Type: (Object<string, ConceptNetworkNodeState> | {})
value
number Node's activation valueold
number? Node's old activation valueage
number? Number of propagations
Activate the node which label
is given
cns
ConceptNetworkStatelabel
string
Returns ConceptNetworkState
Get the activation value of the node which label
is given
cns
ConceptNetworkStatelabel
string
Get the activation value of a node (which label
is given)
cns
ConceptNetworkStatelabel
string
Get the maximum activation value of all nodes which label starts with
beginning
.
cns
ConceptNetworkStatebeginning
string (optional, default''
)
Returns number
Return an object associating nodes labels with their activation values, but
only for labels starting with beginning
and activation values greater or
equal to threshold
.
cns
ConceptNetworkStatebeginning
string (optional, default''
)threshold
number (optional, default95
)
Set the activation value
of a node label
.
cns
ConceptNetworkState (optional, default{}
)label
stringvalue
number
Returns ConceptNetworkState
Propagate the activation values along the links.
cn
ConceptNetworkcns
ConceptNetworkStateoptions
(optional, default{decay:40,memoryPerf:100}
)
Returns ConceptNetworkState