NeuralEngine
A Game Engine with embeded Machine Learning algorithms based on Gaussian Processes.
NeuralEngine::MachineLearning::DiscreteFactorNode Class Reference

Base Class INode. More...

#include <FgDiscreteFactorNode.h>

Inheritance diagram for NeuralEngine::MachineLearning::DiscreteFactorNode:
Collaboration diagram for NeuralEngine::MachineLearning::DiscreteFactorNode:

Public Member Functions

 DiscreteFactorNode (DiscreteVariableNode &node, std::string name)
 Default constructor. More...
 
 DiscreteFactorNode (DiscreteVariableNode &node)
 Constructor. More...
 
 DiscreteFactorNode (std::vector< DiscreteVariableNode * > nodes, std::string name)
 Constructor. More...
 
 DiscreteFactorNode (std::vector< DiscreteVariableNode * > nodes)
 Constructor. More...
 
 ~DiscreteFactorNode ()
 Destructor. More...
 
virtual bool IsSupported (MsgType type)
 Query if message type is supported. More...
 
void SetPotential (double potential, int index)
 Sets a potential at given index. More...
 
void AddPotential (double potential)
 Adds a potential. More...
 
double GetPotential (int index)
 Gets a potential. More...
 
- Public Member Functions inherited from NeuralEngine::MachineLearning::IFactorNode
 IFactorNode (IVariableNode &node)
 Constructor. More...
 
 IFactorNode (IVariableNode &node, std::string name)
 Constructor. More...
 
template<class T >
 IFactorNode (std::vector< T * > nodes, std::string name)
 Constructor. More...
 
template<class T >
 IFactorNode (std::vector< T * > nodes)
 Constructor. More...
 
 ~IFactorNode ()
 Destructor. More...
 
virtual bool IsSupported (MsgType type)=0
 Query if message type is supported. More...
 
- Public Member Functions inherited from NeuralEngine::MachineLearning::INode
 INode (std::string name)
 Default constructor. More...
 
 ~INode ()
 Destructor. More...
 
std::string Name ()
 Gets the name. More...
 
virtual void SendMsg (std::string toNodeName)
 Sends a message. More...
 
virtual void ReceiveMsg (std::string fromNodeName, IMessage &message)
 Receives a message. More...
 
virtual void AddIncoming (INode *node)
 Adds ingoing connection to the node. More...
 
virtual void AddOutgoing (INode *node)
 Adds outgoing connection to the node. More...
 
virtual void AddConnection (INode *node, const std::string &tag)
 Adds a custom connection with the given tag. More...
 
virtual bool IsSupported (MsgType type)=0
 Query if message type is supported. More...
 
const MsgBox & GetAllMessages () const
 Gets all the messages of this node. More...
 
void ClearMessages ()
 Clears all incomming messages for next iteration. More...
 

Protected Member Functions

virtual IMessage ComputeMessage (std::string toNodeName, MsgBox &neededMessages)
 Calculate a message to connectd node. More...
 
virtual IMessage ComputeMessage (std::string toNodeName, MsgBox &neededMessages)=0
 Calculates a message to connectd node. More...
 
- Protected Member Functions inherited from NeuralEngine::MachineLearning::INode
void SetMessage (std::string fromNodeName, IMessage &msg)
 Sets a incomming message from specific node. More...
 
virtual IMessage ComputeMessage (std::string fromNodeName, MsgBox &neededMessages)=0
 Virtual function to calculate a message to connectd node. More...
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, unsigned int version)
 

Private Attributes

std::vector< double > vP
 

Friends

class boost::serialization::access
 

Additional Inherited Members

- Protected Attributes inherited from NeuralEngine::MachineLearning::INode
std::map< std::string, INode * > mNodes
 
MsgBox mMessageBox
 
std::set< std::string > sIncomming
 
std::set< std::string > sOutgoing
 
std::map< std::string, std::string > mConnections
 

Detailed Description

Base Class INode.

Basic functionalities of a Node in a Factor Graph.

Admin, 7/24/2017.

Definition at line 31 of file FgDiscreteFactorNode.h.

Constructor & Destructor Documentation

◆ DiscreteFactorNode() [1/4]

NeuralEngine::MachineLearning::DiscreteFactorNode::DiscreteFactorNode ( DiscreteVariableNode node,
std::string  name 
)

Default constructor.

Admin, 7/24/2017.

Parameters
nodeThe corresponding variable node.
nameThe name.
IDThe identifier.

◆ DiscreteFactorNode() [2/4]

NeuralEngine::MachineLearning::DiscreteFactorNode::DiscreteFactorNode ( DiscreteVariableNode node)

Constructor.

Hmetal T, 11.08.2017.

Parameters
nodeThe corresponding variable node.
IDThe identifier.

◆ DiscreteFactorNode() [3/4]

NeuralEngine::MachineLearning::DiscreteFactorNode::DiscreteFactorNode ( std::vector< DiscreteVariableNode * >  nodes,
std::string  name 
)

Constructor.

Admin, 8/31/2017.

Parameters
nodes[in,out] If non-null, the corresponding variable nodes.
nameThe name of the node.

◆ DiscreteFactorNode() [4/4]

NeuralEngine::MachineLearning::DiscreteFactorNode::DiscreteFactorNode ( std::vector< DiscreteVariableNode * >  nodes)

Constructor.

Admin, 8/31/2017.

Parameters
nodes[in,out] If non-null, the corresponding variable nodes.

◆ ~DiscreteFactorNode()

NeuralEngine::MachineLearning::DiscreteFactorNode::~DiscreteFactorNode ( )

Destructor.

Admin, 7/24/2017.

Member Function Documentation

◆ IsSupported()

virtual bool NeuralEngine::MachineLearning::DiscreteFactorNode::IsSupported ( MsgType  type)
virtual

Query if message type is supported.

Admin, 7/25/2017.

Parameters
typeThe message type.
Returns
true if supported, false if not.

Implements NeuralEngine::MachineLearning::IFactorNode.

◆ SetPotential()

void NeuralEngine::MachineLearning::DiscreteFactorNode::SetPotential ( double  potential,
int  index 
)

Sets a potential at given index.

Admin, 8/31/2017.

Parameters
potentialThe potential.
indexZero-based index of the potential.

◆ AddPotential()

void NeuralEngine::MachineLearning::DiscreteFactorNode::AddPotential ( double  potential)

Adds a potential.

Admin, 8/31/2017.

Parameters
potentialThe potential.

◆ GetPotential()

double NeuralEngine::MachineLearning::DiscreteFactorNode::GetPotential ( int  index)

Gets a potential.

Admin, 8/31/2017.

Parameters
indexZero-based index of the.
Returns
The potential.

◆ ComputeMessage()

virtual IMessage NeuralEngine::MachineLearning::DiscreteFactorNode::ComputeMessage ( std::string  toNodeName,
MsgBox &  neededMessages 
)
protectedvirtual

Calculate a message to connectd node.


Different computations for all kinds of derived classes of node types.

Admin, 7/26/2017.

Parameters
toNodeNameIdentifier for receiver node.
neededMessagesAll incomming messages, exept from receiver node.
Returns
The calculated message.

Implements NeuralEngine::MachineLearning::IFactorNode.

◆ serialize()

template<class Archive >
void NeuralEngine::MachineLearning::DiscreteFactorNode::serialize ( Archive &  ar,
unsigned int  version 
)
inlineprivate

Definition at line 148 of file FgDiscreteFactorNode.h.

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 145 of file FgDiscreteFactorNode.h.

Member Data Documentation

◆ vP

std::vector<double> NeuralEngine::MachineLearning::DiscreteFactorNode::vP
private

Definition at line 143 of file FgDiscreteFactorNode.h.


The documentation for this class was generated from the following file: