From 0d2d8121cbb6a45180d88021fe2e5ac86b3532e3 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sat, 5 May 2007 15:57:58 +0000 Subject: 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 --- ai/Net.cpp | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 ai/Net.cpp (limited to 'ai/Net.cpp') 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; +} -- cgit