SmartEngine
1.6.0
Native
Library
API
GraphNode.h
1
// Copyright (C) Entropy Software LLC - All Rights Reserved
2
3
#pragma once
4
5
#include "Context.h"
6
#include "Matrix.h"
7
#include "Object.h"
8
9
namespace
SmartEngine
10
{
11
12
#pragma pack(push, 4)
13
struct
GraphNodeCInfo
17
{
21
const
char
*
name
=
nullptr
;
22
26
IContext
*
context
=
nullptr
;
27
};
28
#pragma pack(pop)
29
33
class
SMARTENGINE_EXPORT
IGraphNode
:
public
virtual
IObject
34
{
35
public
:
36
SMARTENGINE_DECLARE_CLASS(
IGraphNode
)
37
38
39
virtual
const
char
* GetName()
const
= 0;
42
47
virtual
int
GetOutputDimension
()
const
= 0;
48
52
virtual
ObjectPtr<IMatrix>
Execute
() = 0;
53
57
virtual
ObjectPtr<IMatrix>
GetLastExecutionResult
() = 0;
58
};
59
61
extern
"C"
62
{
63
SMARTENGINE_EXPORT
const
char
* GraphNode_GetName(ObjPtr
object
);
64
SMARTENGINE_EXPORT
int
GraphNode_GetOutputDimension(ObjPtr
object
);
65
SMARTENGINE_EXPORT ObjPtr GraphNode_Execute(ObjPtr
object
);
66
SMARTENGINE_EXPORT ObjPtr GraphNode_GetLastExecutionResult(ObjPtr
object
);
67
}
69
70
}
// namespace SmartEngine
SmartEngine::IGraphNode
A logical node in the AI graph. Some nodes, like NeuralNetwork, are composed of other nodes (neuron l...
Definition:
GraphNode.h:34
SmartEngine::IGraphNode::Execute
virtual ObjectPtr< IMatrix > Execute()=0
Synchronously execute the graph. The returned matrix is read-only.
SmartEngine::IGraphNode::GetLastExecutionResult
virtual ObjectPtr< IMatrix > GetLastExecutionResult()=0
Get the results of last execution of the graph. The returned matrix is read-only.
SmartEngine::GraphNodeCInfo::name
const char * name
The name of this node.
Definition:
GraphNode.h:21
SmartEngine::ObjectPtr
Smart pointer to an IObject. Automatic ref counting.
Definition:
ObjectPtr.h:16
SmartEngine
Definition:
A2CTrainer.h:10
SmartEngine::IObject
Base class for SmartEngine AI objects. It is not common to deal with this class directly.
Definition:
Object.h:19
SmartEngine::GraphNodeCInfo::context
IContext * context
Context this node belongs to. Only graph nodes of the same context can be connected.
Definition:
GraphNode.h:26
SmartEngine::IContext
Every node in the AI graph must belong to the same context.
Definition:
Context.h:40
SmartEngine::IGraphNode::GetOutputDimension
virtual int GetOutputDimension() const =0
Returns the dimension of a single row of this node's output. The Output property's length will be a m...
Generated by
1.8.20