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

📄 applyhousehint.h

📁 爱因斯坦谜题
💻 H
字号:
// ApplyHouseHint.h: interface for the CApplyHouseHint class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_APPLYHOUSEHINT_H__1B22480A_2B39_4083_AF31_B658FE3E933B__INCLUDED_)
#define AFX_APPLYHOUSEHINT_H__1B22480A_2B39_4083_AF31_B658FE3E933B__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "ApplyHint.h"

class CApplyHouseHint : public CApplyHint  
{
protected:
	virtual void Apply(const CSolutionSet &input, CSolutionSet &output);
	virtual void ApplyHint(const CSolution &sln, CSolutionSet &output);
	void filter_out(const CSolutionSet &in_set, CSolutionSet &out_set);
	virtual bool IsHousesOk(int h1, int h2) = 0;

	// 检查输入集合的每个方案是否包含给定属性
	// 将已包含给定属性的方案添加到输出集合
	// 对于没有包含给定属性的方案,穷举增加指定属性的所有方案,添加到输出集合
	static void enum_attr(const CSolutionSet &in_set, CSolutionSet &out_set, CAttributeVal attr);

	// 保证输出集合的House属性没有“未知项”
	static void enum_house(const CSolutionSet &in_set, CSolutionSet &out_set);

	static bool m_house_enum;
	friend void time_test();			// 为了测试时间
};

class CApplyNeighborHint : public CApplyHouseHint
{
protected:
	virtual bool IsHousesOk(int h1, int h2);
};

class CApplyOrderedNeighborHint : public CApplyHouseHint
{
protected:
	virtual bool IsHousesOk(int h1, int h2);
};

#endif // !defined(AFX_APPLYHOUSEHINT_H__1B22480A_2B39_4083_AF31_B658FE3E933B__INCLUDED_)

⌨️ 快捷键说明

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