Construct version 5.4.4
An agent based modeling framework
|
Class to contain the medium used by an InteractionMessage. More...
Public Member Functions | |
CommunicationMedium (const Node &node) | |
Constructor for a medium based on a medium node. More... | |
CommunicationMedium (const std::string &name, unsigned int medium_node_index, float max_percent_learnable, unsigned int max_msg_complexity, unsigned int time_to_send) | |
Constructor for a medium. More... | |
Public Attributes | |
const std::string | name |
The medium's name. | |
const float | max_percent_learnable |
maximum value the knowledge strength network can be increased to from a message with this medium | |
const unsigned int | time_to_send |
how many timeperiods must pass before a message with this medium is sent to the central message queue | |
const unsigned int | max_msg_complexity |
the maximum number of InteractionItem that can be included in a message with this medium | |
const unsigned int | index |
The medium's node index. | |
const bool | valid |
True if the medium is a valid medium. | |
Class to contain the medium used by an InteractionMessage.
CommunicationMedium::CommunicationMedium | ( | const Node & | node | ) |
Constructor for a medium based on a medium node.
The medium node is expected to have attributes "maximum message complexity", "maximum percent learnable", and "time to send". If these attributes are missing, a warning is issued and the medium is no longer valid.
node | Iterator pointer to the medium node used to construct this medium. |
Example
Output:
Is this medium valid? True maxMsgComplexity: 1 maximumPercentLearnable: 1 time_to_send: 0
Exception Safety
If the node attributes are not found, a dynet::could_not_find_parameter exception is thrown. If the node attributes value could not be converted to the appropriate type, a dynet::could_not_convert exception is thrown.
CommunicationMedium::CommunicationMedium | ( | const std::string & | name, |
unsigned int | medium_node_index, | ||
float | max_percent_learnable, | ||
unsigned int | max_msg_complexity, | ||
unsigned int | time_to_send | ||
) |
Constructor for a medium.
name | Name of the medium |
medium_node_index | Index of this medium in the "medium" Nodeset |
max_percent_learnable | Maximum amount of knowledge that can be learned via this medium. |
max_msg_complexity | Limits the size of a InteractionMessage that uses this medium. |
time_to_send | Number of timeperiods before this message is sent. |
Example
Output:
Is this medium valid? True maxMsgComplexity: 1 maximumPercentLearnable: 1 time_to_send: 0
Exception Safety
No-throw guarantee: this constructor never throws exceptions.