summaryrefslogtreecommitdiffstats
path: root/ai/Net.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2007-05-05 15:57:58 +0000
committerBen Boeckel <MathStuf@gmail.com>2007-05-05 15:57:58 +0000
commit0d2d8121cbb6a45180d88021fe2e5ac86b3532e3 (patch)
tree512385f11f6d152f76ac36c7950bfe75992291ff /ai/Net.cpp
parent21cb50c82f18b3a2ee1e77a7de11413ce45e6587 (diff)
Got rid of XML for INI format, in process of moving over; added /ai/Net.{h, cpp}
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@8 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'ai/Net.cpp')
-rw-r--r--ai/Net.cpp51
1 files changed, 51 insertions, 0 deletions
diff --git a/ai/Net.cpp b/ai/Net.cpp
new file mode 100644
index 00000000..4e406ad9
--- /dev/null
+++ b/ai/Net.cpp
@@ -0,0 +1,51 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name: ai/Net.cpp
+// Purpose: An artificial neural network class
+// Author: Ben Boeckel
+// Modified by: Ben Boeckel
+// Created: Fri May 4 19:56:27 2007
+// Copyright: ©2007 Nerdy Productions
+// Licence:
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+/////////////////////////////////////////////////////////////////////////////
+
+#include "Net.h"
+
+PokeGen::NeuralNetwork::Net::Net(int numInputNode, int numHiddenNode, int numOutputNode)
+{
+ layers[0] = new Layer(NULL, layers[1], numInputNode);
+ layers[1] = new Layer(layers[0], layers[2], numHiddenNode);
+ layers[2] = new Layer(layers[1], NULL, numOutputNode);
+ /*
+ layers = new Layer*[numLayers];
+ layers[0] = new Layer(NULL, layers[1], numNodes[0]);
+ for (int i = 1; i < numLayers - 1; ++i)
+ layers[i] = new Layer(layers[i - 1], layers[i + 1], numNodes[i]);
+ layers[i] = new Layer(layers[i - 1], NULL, numNodes[i]);
+ */
+}
+
+PokeGen::NeuralNetwork::Net::Net(const char *fname)
+{
+
+}
+
+PokeGen::NeuralNetwork::Net::~Net()
+{
+ //for (int i = numLayers - 1; i >=0; --i)
+ for (int i = 2; i >=0; --i)
+ delete layers[i];
+ //delete[] layers;
+}