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

📄 improvedpredictor.h

📁 AI Game Programming Wisdom一书的源码
💻 H
字号:
//----------------------------------------------------------------------------------------------
// Sequential Prediction Demo: The positioning pattern
// 
// Author:  Fri Mommersteeg
// Date:    10-09-2001
// File:    ImprovedPredictor.h
//----------------------------------------------------------------------------------------------

#ifndef __IMPROVEDPREDICTOR_H
#define __IMPROVEDPREDICTOR_H

//----------------------------------------------------------------------------------------------
// Include files
//----------------------------------------------------------------------------------------------

#include "StringMatchPredictor.h"
#include "Array.h"

//----------------------------------------------------------------------------------------------
// CImprovedPredictor: Enhances the standard string-matching predictor by taking all matching
//					   substrings into account
//
// Note: The Performance Indicator is normalized. This means that when you set up the predictor,
// the fMinPerformance parameter is a chance (between 0 and 1) that indicates the minimum
// desired probability that the prediction is correct.
//----------------------------------------------------------------------------------------------

class CImprovedPredictor : public CStringMatchPredictor {
public:
	void			Setup(int nWindowSize, int nAlphabetSize, float fMinPerformance);
	virtual void	Update(int NextElement);
	virtual bool	GetPrediction(int &Prediction);

protected:
	void			CalculatePrediction();

protected:
	CArray <float>	m_Alphabet;
	float			m_TotalPredictionValue;
	float			m_HighestPredictionValue;
	float			m_fMinPerformance;
};

//----------------------------------------------------------------------------------------------
#endif // __IMPROVEDPREDICTOR_H

⌨️ 快捷键说明

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