new AssociativeMap(nameopt)
- Description:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
name |
string |
<optional> |
An optional name. By default, a |
Methods
add(key, value)
- Description:
Adds a new symbol pair to the container.
- Adding twice the same key/value pair corresponds to adding their belief level
tau.
- Adding twice the same key/value pair corresponds to adding their belief level
Parameters:
| Name | Type | Description |
|---|---|---|
key |
Symbol | The symbol key to add or modify. |
value |
Symbol | The symbol value to add. |
erase(keyopt)
- Description:
Erases a symbol in the container.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
key |
Symbol |
<optional> |
The symbol key to add or modify.
|
get(key) → {Symbol}
- Description:
Returns an approximate value of the associative map by unbinding.
- For a map with
>_i B_(y_i) x_ireturnsx_iify_iis a map key mapping only one symbol.>_(i_j) x_(i_j)ify_iis a map key mapping several symbolsx_(i_j).B(y_i~) >_j B_(y_j) x_jify_iis not a map key.
- For a map with
Parameters:
| Name | Type | Description |
|---|---|---|
key |
Symbol | String | The symbol key |
Returns:
value A reference to the stored value, available until program end.
- If several values associated to a key, it is returned as a bundling.
- Type
- Symbol
get()
- Description:
Defines an iterator over the associative map symbols, used in a construct of the form:
for(auto it = associativeMap.get().cbegin(); it != associativeMap.get().cend(); it++) { const Symbol& key = *(it->second.first); for(auto jt = it->second.second.cbegin(); jt != it->second.second.cend(); jt++) { const Symbol& value = *(jt->second); ../.. }- This is NOT a VSA plausible operation (unless another List data structure is used) by a debugging function.
- A map can have several values for one key, combined in the values bundling.
Returns:
A const std::unordered_map < unsigned int, std::pair < const Symbol *, std::unordered_map < unsigned int, Symbol * >>> & reference for associative map iteration.
getBundling() → {Bundling}
- Description:
Returns the bundling representation of this associative map.
Returns:
A reference to the bundling representation.
- Type
- Bundling
getSize() → {uint}
- Description:
Returns the number of key-value pairs this associative map.
Returns:
The number of key-value pairs.
- Type
- uint
asString() → {String}
- Description:
Returns the value as a string.
Returns:
A string of the form { key: value ...}_<belief>, omitting the belief if tau=1, sigma=0.
- Type
- String
getValue(key) → {Symbol}
- Description:
Returns an approximate value of the associative map by unbinding.
Parameters:
| Name | Type | Description |
|---|---|---|
key |
Symbol | String | The symbol key |
Returns:
value A reference to the stored values as a bundling, available until program end.
- Type
- Symbol
getKey(value) → {Symbol}
- Description:
Returns an approximate key of the associative map by unbinding.
Parameters:
| Name | Type | Description |
|---|---|---|
value |
Symbol | String | The symbol value |
Returns:
key A reference to the stored keys as a bundling, available until program end.
- Type
- Symbol