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

📄 equalfrequencyscaler.cpp

📁 粗糙集应用软件
💻 CPP
字号:
//-------------------------------------------------------------------
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Revisions.....:
//===================================================================

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

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

#include <kernel/structures/decisiontable.h>

#include <kernel/utilities/mathkit.h>

//-------------------------------------------------------------------
// Methods for class EqualFrequencyScaler.
//===================================================================

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

EqualFrequencyScaler::EqualFrequencyScaler() {
	SetNoIntervals(3);
}

EqualFrequencyScaler::~EqualFrequencyScaler() {
}

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

IMPLEMENTIDMETHODS(EqualFrequencyScaler, EQUALFREQUENCYSCALER, OrthogonalScaler)

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

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

String
EqualFrequencyScaler::GetParameters() const {

	String parameters = OrthogonalScaler::GetParameters();

	parameters += Keyword::Separator();

	parameters += Keyword::Intervals();
	parameters += Keyword::Assignment();
	parameters += String::Format(GetNoIntervals());

	return parameters;

}

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

bool
EqualFrequencyScaler::SetParameter(const String &keyword, const String &value) {

	if (keyword == Keyword::Intervals() && value.IsInteger())
		return SetNoIntervals(value.GetInteger());

	return OrthogonalScaler::SetParameter(keyword, value);

}

//-------------------------------------------------------------------
// Methods inherited from OrthogonalScaler.
//===================================================================

//-------------------------------------------------------------------
// Method........: FindCuts
// Author........: Aleksander 豩rn
// Date..........:
// Description...: Attempts to create a given number of intervals with
//                 an approximately equal number of objects within each
//                 interval. This may not always be possible, smarter
//                 logic may be added to handle such cases.
// Comments......:
// Revisions.....: A

⌨️ 快捷键说明

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