tcontrollor.h

来自「根据人工智能的模糊理论编写的温度控制程序」· C头文件 代码 · 共 42 行

H
42
字号
// TControllor.h: interface for the CTControllor class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_TCONTROLLOR_H__9C3F7BD8_998C_442D_A21D_0E94BBBD56F5__INCLUDED_)
#define AFX_TCONTROLLOR_H__9C3F7BD8_998C_442D_A21D_0E94BBBD56F5__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
struct Variable{
	float value;       //变量的值
	float belong[5];  //变量对于五个模糊量的隶属度->NB,NS,ZO,PS,PB
};
class CTControllor  
{
public:
	float enhance;
	void MainContrllor();
	Variable detaE; //每次采样的温度变化率
	Variable E; //当前温度与目标温度差值
	float T;	//当前温度
	CTControllor();
	virtual ~CTControllor();

private:
	void UseFun();
	int cnt;
	float GetMTW(Variable &X);
	void CalculateW();
	void WriteRules();
	float w0;
	Variable W;   //温度控制器输出量
	float using_rule_weight[9]; //推理中用到规则的权重
	int using_rule[9]; //推理使用的规则->0~8为1~9条推理规则
	void CalBelong(Variable &v);
	float Max(float a,float b);
	float Min(float a,float b);
};

#endif // !defined(AFX_TCONTROLLOR_H__9C3F7BD8_998C_442D_A21D_0E94BBBD56F5__INCLUDED_)

⌨️ 快捷键说明

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