13#include <NeMachineLearningLib.h>
14#include <MachineLearning/FgIMessage.h>
18#include <MachineLearning/FgArrayFireSerialization.h>
22 namespace MachineLearning
67 virtual void SendMsg(std::string toNodeName);
228 std::map<std::string, INode*> mNodes;
230 std::set<std::string> sIncomming;
231 std::set<std::string> sOutgoing;
233 std::map<std::string, std::string> mConnections;
236 friend class boost::serialization::access;
238 template<
class Archive>
239 void serialize(Archive& ar,
unsigned int version)
241 ar& BOOST_SERIALIZATION_NVP(mNodes);
242 ar& BOOST_SERIALIZATION_NVP(sIncomming);
243 ar& BOOST_SERIALIZATION_NVP(sOutgoing);
244 ar& BOOST_SERIALIZATION_NVP(mMessageBox);
245 ar& BOOST_SERIALIZATION_NVP(sName);
virtual void SendMsg(std::string toNodeName)
Sends a message.
virtual bool IsSupported(MsgType type)=0
Query if message type is supported.
const MsgBox & GetAllMessages() const
Gets all the messages of this node.
void SetMessage(std::string fromNodeName, IMessage &msg)
Sets a incomming message from specific node.
INode(std::string name)
Default constructor.
virtual void AddConnection(INode *node, const std::string &tag)
Adds a custom connection with the given tag.
virtual void ReceiveMsg(std::string fromNodeName, IMessage &message)
Receives a message.
std::string Name()
Gets the name.
virtual void AddOutgoing(INode *node)
Adds outgoing connection to the node.
void ClearMessages()
Clears all incomming messages for next iteration.
virtual IMessage ComputeMessage(std::string fromNodeName, MsgBox &neededMessages)=0
Virtual function to calculate a message to connectd node.
virtual void AddIncoming(INode *node)
Adds ingoing connection to the node.