standardvoter.cpp

来自「粗糙集应用软件」· C++ 代码 · 共 117 行

CPP
117
字号
//-------------------------------------------------------------------
// Author........: Aleksander 豩rn
// Date..........: 9608/9609
// Description...:
// Revisions.....:
//===================================================================

#include <stdafx.h> // Precompiled headers.
#include <copyright.h>

#include <kernel/algorithms/standardvoter.h>
#include <kernel/algorithms/keyword.h>

#include <kernel/structures/informationvector.h>
#include <kernel/structures/rule.h>
#include <kernel/structures/reduct.h>
#include <kernel/structures/decisiontable.h>
#include <kernel/structures/rulebasedclassification.h>

#include <kernel/utilities/creator.h>

#include <kernel/basic/message.h>

//-------------------------------------------------------------------
// Methods for class StandardVoter.
//===================================================================

//-------------------------------------------------------------------
// Constructors/destructor.
//===================================================================

//-------------------------------------------------------------------
// Method........: Constructor
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Comments......:
// Revisions.....:
//===================================================================

StandardVoter::StandardVoter() {
	SetVotingStrategy(VOTING_SUPPORT);
	SetNormalizationStrategy(NORMALIZATION_FIRING);
	ExcludeGeneralizations(false);
}

//-------------------------------------------------------------------
// Method........: Destructor
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Comments......:
// Revisions.....:
//===================================================================

StandardVoter::~StandardVoter() {
}

//-------------------------------------------------------------------
// Methods inherited from Identifier.
//===================================================================

IMPLEMENTIDMETHODS(StandardVoter, STANDARDVOTER, Voter)

//-------------------------------------------------------------------
// Methods inherited from Algorithm.
//===================================================================

//-------------------------------------------------------------------
// Method........: GetParameters
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Comments......:
// Revisions.....:
//===================================================================

String
StandardVoter::GetParameters() const {

	String parameters;

	// Get parameters higher up.
	parameters += Voter::GetParameters();

	parameters += Keyword::Separator();

	// Exclude generalizations (choose most specific rule).
	parameters += Keyword::Specific();
	parameters += Keyword::Assignment();
	parameters += String::Format(ExcludeGeneralizations());

	parameters += Keyword::Separator();

	// Voting strategy.
	parameters += Keyword::Voting();
	parameters += Keyword::Assignment();
	parameters += GetString(GetVotingStrategy());

	parameters += Keyword::Separator();

	// Normalization strategy.
	parameters += Keyword::Normalization();
	parameters += Keyword::Assignment();
	parameters += GetString(GetNormalizationStrategy());

	return parameters;

}

//-------------------------------------------------------------------
// Method........: SetParameter
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Comments......:
// Revisions.....: A

⌨️ 快捷键说明

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