⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pacman.h

📁 也是遗传算法的源代码
💻 H
字号:
/***************************************************************************                          pacman.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 PACMAN_H#define PACMAN_H#ifdef __cplusplusextern "C" {#endif /* __cplusplus */// the maximum value of any member is MAXFEELING.typedef struct _Senses {    float upGood;    float downGood;    float leftGood;    float rightGood;    float upBad;    float downBad;    float leftBad;    float rightBad;    float pain;    float pleasure;    int upTouch;    int downTouch;    int leftTouch;    int rightTouch;} Senses;void initialize();int getLives();void initLevel();int levelFinished();void singleStep(int key);void ActualizaNivel();int getFinalScore();Senses* getFeeling();void returnResults(int score);#ifdef __cplusplus}#include "amygdala/network.h"#include "amygdala/genome.h"#include "amygdala/genomehandler.h"#include "amygdala/gamanager.h"#include "pacmanspikeoutput.h"#include <string>class  PacmanSpikeInput;class Cherrymoya;/** the central class of the simulation. Links ManIX, Genome and Amygdala   * Our model is a sphere of neurons with a radius of 4 neurons   * within this sphere, groups of input/output neurons are distributed   * as determined by a genome.   <p>   * Many thanks to Fernando J. G. Pereira for his great Pacman game Manix  *@author Rudiger Koch  */class Pacman : public GAManager{public:  Pacman();  ~Pacman();  /** Move pacman. Returns the new feeling after that move */  Senses* step();  virtual unsigned int GetScore();  virtual void Setup(string genefile);private:    PacmanSpikeInput *spikeIn;    PacmanSpikeOutput *spikeOut;protected: // Protected attributes    unsigned int lastStep;private: // Private methods/** We can put in some knowledge to ease the job of the GA:<br>  * We know that Pacman cannot move up if there is a wall. So we  * connect the upTouch input neuron with the up output neuron  * using an inhibitory synapse. */    void HardwireNeurons(Cherrymoya *c);};#endif /* __cplusplus */#endif

⌨️ 快捷键说明

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