-
Notifications
You must be signed in to change notification settings - Fork 0
/
IgodotNNInterfaces.cpp
107 lines (97 loc) · 2.72 KB
/
IgodotNNInterfaces.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#include "IgodotNNInterfaces.h"
std::ostream& operator<<(std::ostream& os, const PoolRealArray& poolArray)
{
os<<"Array :"<<std::endl;
for(int counter = 0; counter < poolArray.size() ; ++counter)
{
os<<poolArray.get(counter)<<" ";
}
os<<" "<<std::endl;
return os;
}
IGodotNNInterfaces::IGodotNNInterfaces(const IGodotNNInterfaces& copyFromThis)
{
this->_inputVector = copyFromThis._inputVector;
this->_outputVector = copyFromThis._outputVector;
this->_multipleInputVector = copyFromThis._multipleInputVector;
}
IGodotNNInterfaces::IGodotNNInterfaces(IGodotNNInterfaces&& moveFromThis)
{
this->_inputVector = moveFromThis._inputVector;
this->_outputVector = moveFromThis._outputVector;
this->_multipleInputVector = moveFromThis._multipleInputVector;
moveFromThis._inputVector.clear();
moveFromThis._outputVector.clear();
moveFromThis._multipleInputVector.clear();
}
void IGodotNNInterfaces::ClearAllData()
{
_inputVector.clear();
_outputVector.clear();
_multipleInputVector.clear();
}
void IGodotNNInterfaces::SetInputs(const PoolRealArray& setToThis)
{
int incomingSize = setToThis.size();
_inputVector.clear();
_inputVector.resize(incomingSize);
for(int indexer = 0; indexer < incomingSize; ++indexer)
{
_inputVector[indexer] = setToThis.get(indexer);
}
#ifdef NNDEBUG
std::cout<<"Inputs Are Set"<<std::endl;
for(auto& eachmember: _inputVector)
std::cout<<eachmember<<std::endl;
#endif
}
void IGodotNNInterfaces::SetOutputs(const PoolRealArray& setToThis)
{
int incomingSize = setToThis.size();
_outputVector.clear();
_outputVector.resize(incomingSize);
for(int indexer = 0; indexer < incomingSize; ++indexer)
{
_outputVector[indexer] = setToThis.get(indexer);
}
#ifdef NNDEBUG
std::cout<<"outputs Are Set"<<std::endl;
for(auto& eachmember: _inputVector)
std::cout<<eachmember<<std::endl;
#endif
}
std::vector<double> IGodotNNInterfaces::GetInputVector() const noexcept
{
return _inputVector;
}
std::vector<double> IGodotNNInterfaces::GetOutputVector()
{
return _outputVector;
}
void IGodotNNInterfaces::InsertMultipleInput(const PoolRealArray &toThis)
{
int incomingSize = toThis.size();
std::vector<double> tempinputVector;
tempinputVector.resize(incomingSize);
for(int indexer = 0; indexer < incomingSize; ++indexer)
{
tempinputVector[indexer] = toThis.get(indexer);
}
_multipleInputVector.push_back(tempinputVector);
#ifdef NNDEBUG
std::cout<<"Multiple Inputs Are Set"<<std::endl;
for(const auto& eachArray: _multipleInputVector)
{
std::cout<<"Array :"<<std::endl;
for(const auto& eachMember : eachArray)
{
std::cout<<eachMember<<" ";
}
std::cout<<" "<<std::endl;
}
#endif
}
std::vector<std::vector<double>> IGodotNNInterfaces::GetMultipleInput() const noexcept
{
return _multipleInputVector;
}