pacmanspikeoutput.h

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

H
64
字号
/***************************************************************************                          pacmanspikeoutput.h  -  description                             -------------------    begin                : Tue Nov 6 2001    copyright            : (C) 2001 by Rudiger Koch    email                : rkoch@rkoch.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 PACMANSPIKEOUTPUT_H#define PACMANSPIKEOUTPUT_H#include "amygdala/spikeoutput.h"#include "amygdala/types.h"#include "amygdala/neuron.h"#if GCC_VERSION >= 30000    #include <ext/hash_map>#else    #include <hash_map>#endif#include <vector>#include <stdio.h>/** Collect the output of the Pacman NN and generate Pacman movements out of it  *  *@author Rudiger Koch  */class PacmanSpikeOutput : public SpikeOutput  {public:	PacmanSpikeOutput();	~PacmanSpikeOutput();  /** Get output events and see if they are a vote for a direction */  void OutputEvent(AmIdInt neuronId, AmTimeInt eventTime);  /** add an outputneuron */  void SetOutputNeurons(vector <Neuron*> oNeurons);  /** Nothing to do here */  void OutputCache();  /** Retrieve the next move. This can be: <br>    right = 'P' <br>    left  = 'O' <br>    up    = 'Q' <br>    down  = 'A' */  int getDirection();private:    vector <Neuron*> outputNeurons;    int spikeCounter[4];    FILE*  plotfile;};#endif

⌨️ 快捷键说明

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