Construct version 5.4.4
An agent based modeling framework
|
Nodes are any type of entity with or without attributes. More...
Public Member Functions | |
Node (const std::string &_name, unsigned int _index, const dynet::ParameterMap &atts) | |
Constructor stores but does not take ownership of attribute pointers. More... | |
const std::string & | get_attribute (const std::string &attribute_name) const |
Searches for a node attribute. More... | |
const std::string & | operator[] (const std::string &attribute_name) const |
Public Attributes | |
const dynet::ParameterMap & | attributes |
Each attribute value is stored in the parameter map at the appropriate attribute key. | |
const std::string | name |
Name of the node | |
const unsigned int | index |
Node index of the node | |
Nodes are any type of entity with or without attributes.
Nodes are created to be linked up via networks. Nodes can have attributes which affect the dynamics of a model. Nodes are not expected to be created outside of the NodesetManager. Rather, pointers and iterators to already existing nodes are utilized.
|
inline |
Constructor stores but does not take ownership of attribute pointers.
const std::string & Node::get_attribute | ( | const std::string & | attribute_name | ) | const |
Searches for a node attribute.
Uses the unordered_set::find function to find an attribute. If the attribute is not found, an empty string is returned.
attribute_name | Name of the attribute to search for. |
Example
Output:
This node's gender is male
Complexity
Same complexity as unordered_set::find
Iterator validity
No changes
Exception Safety
If the attribute name is not found in a node's attributes a dynet::missing_node_attribute is thrown.
|
inline |