ehcm.h

来自「该文件是包含了机器人足球比赛中的整个系统的代码」· C头文件 代码 · 共 110 行

H
110
字号
#ifndef EHCM_H
#define EHCM_H

#include "Dude.h"
#include "../TOOLS/Utilities.h"

class EHCM : public Dude {

#define stepFreqIndex 0
#define maxForwardIndex 1
#define maxBackIndex 2
#define fshIndex 3
#define ffoIndex 4
#define fsoIndex 5
#define fhIndex 6
#define bshIndex 7
#define bfoIndex 8
#define bsoIndex 9
#define bhIndex 10

#define dataSize  11

#define SIG 0.025  //was 0.05
#define LIMIT 6  // was 10

public:
	EHCM();
  ~EHCM();

	virtual void NewReadyModel();
	virtual void NewPlayingModel();

  void StartTimer();
  void EndTimer(bool);

  void WriteConfigFile();

  void UpdateVariables();
  void ChangeParameters();

  double GaussianDistribution(double);
  double CauchyDistribution();

  void CheckImprovement();
  void NullBodyy();

  class ParameterSet {
    public :
      ParameterSet();
      void operator=(ParameterSet &right) {
        time = right.time;
        speed = right.speed;
        for (int j = 0; j<dataSize; j++) data[j]=right.data[j];
        for (int i = 0; i < 10; i++) {
          frontLocus[i][0] = right.frontLocus[i][0];
          frontLocus[i][1] = right.frontLocus[i][1];
          backLocus[i][0] = right.backLocus[i][0];
          backLocus[i][1] = right.backLocus[i][1];
        }
      }

      double data[dataSize];
      int time;
      double **frontLocus;
      double **backLocus;
      double speed;
  };

private:
  bool learnType;

  int runCount;
  int trials;
  int successful;
  Utilities utils;
  VisionObject* targetBeacon;
  bool targetGP; 
  bool inPlaying;
  bool paramLearning;
  bool locusFrontLearning;
  bool locusBackLearning;
  double multiplier;
  double maxLocusChange;

  int startFrame;
  int endFrame;

  ParameterSet currentSet;
  ParameterSet lastSet;
  ParameterSet bestSet;
  ParameterSet prevBestSet;
  ParameterSet changeSet;
  ParameterSet lastChangeSet;
  ParameterSet changeBestSet; 

  double alpha;
  double maxAlpha;
  bool decreaseAlpha;
  double decreaseAlphaRate;

  double deltaSpeedC;

  double beaconDistance;
  int beaconCount;
  double prevBeaconDistance;
  double prevWalkDistance;
};

#endif

⌨️ 快捷键说明

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