netiodata.h

来自「也是遗传算法的源代码」· C头文件 代码 · 共 80 行

H
80
字号
/***************************************************************************                          netiodata.h  -  description                             -------------------    copyright            : (C) 2000 by Matt Grover    email                : mgrover@amygdala.org ***************************************************************************//*************************************************************************** *                                                                         * *   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.                                   * *                                                                         * ***************************************************************************/#ifndef NETIODATA_H#define NETIODATA_Husing namespace std;#include <vector>/** @class NetIOData netiodata.h amygdala/netiodata.h  * @author Matt Grover  */class NetIOData {public:    NetIOData(int size);    virtual ~NetIOData();    /**     * Add data about a connection between two neurons.     * Return 1 on success.     */    virtual int AddSynapse(unsigned int neuronId, unsigned int synapseId, float weight);    /**     *  Return the ID of the first neuron and set an internal     *  pointer to that neuron.     */    virtual unsigned int FirstNeuron();    /**     * Return the ID of the next neuron in the sequence and set     * an internal pointer to that neuron.     */    virtual unsigned int NextNeuron();    /**     * Return values for the ID of the first input and its     * weight for the current neuron and set an internal pointer.     */    virtual int FirstSynapse(unsigned int& synId, float& val);    /**     * Return values for the ID of the next input and its     * weight for the current neuron and set an internal pointer.     */    virtual int NextSynapse(unsigned int& synId, float& val);protected:    unsigned int netSize;    // synapse weight storage    struct SynapseData {        unsigned int neuronId;        float weightVal;    };    vector<SynapseData>* synapse;    vector<SynapseData> tempSynapse;    unsigned int* indexId;    unsigned int currNeuronIdx;    unsigned int currSynIdx;};#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?