Skip to content

Commit

Permalink
rename KnowledgeType to GoKnowledgeType, GoUctKnowledgeCombinationTyp…
Browse files Browse the repository at this point in the history
…e to GoKnowledgeCombinationType

git-svn-id: svn://svn.code.sf.net/p/fuego/code/trunk@2026 2e953b5c-c64d-0410-be54-f773e93e544c
  • Loading branch information
mmueller65 committed May 23, 2016
1 parent b69f563 commit f816e8d
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions go/GoAdditiveKnowledge.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
//----------------------------------------------------------------------------

/** Knowledge type is used for knowledge factories. */
enum KnowledgeType
enum GoKnowledgeType
{
KNOWLEDGE_NONE,
KNOWLEDGE_GREENPEEP,
Expand All @@ -30,7 +30,7 @@ enum KnowledgeType
};

/** Combination Type is used for combining multiple additive knowledge. */
enum GoUctKnowledgeCombinationType
enum GoKnowledgeCombinationType
{
COMBINE_MULTIPLY,
COMBINE_GEOMETRIC_MEAN,
Expand Down
6 changes: 3 additions & 3 deletions gouct/GoUctAdditiveKnowledgeMultiple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace {
GoUctAdditiveKnowledgeMultiple::GoUctAdditiveKnowledgeMultiple(
const GoBoard& bd,
float minimum,
GoUctKnowledgeCombinationType combinationType)
GoKnowledgeCombinationType combinationType)
:
GoAdditiveKnowledge(bd),
m_minimum(minimum),
Expand Down Expand Up @@ -96,7 +96,7 @@ GoPredictorType GoUctAdditiveKnowledgeMultiple::PredictorType() const
}

inline void Combine(float& v, float newV,
GoUctKnowledgeCombinationType combinationType)
GoKnowledgeCombinationType combinationType)
{
switch (combinationType)
{
Expand All @@ -122,7 +122,7 @@ inline void Combine(float& v, float newV,

inline void PostProcess(InfoVector& moves,
int nuPredictors,
GoUctKnowledgeCombinationType combinationType)
GoKnowledgeCombinationType combinationType)
{
switch (combinationType)
{
Expand Down
6 changes: 3 additions & 3 deletions gouct/GoUctAdditiveKnowledgeMultiple.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ typedef std::vector<SgUctMoveInfo> InfoVector;
The knowledge is additive in the sense that its combined value is
added in the UCT child selection formula. However, the method
of combining multiple types of knowledge can be chosen - @see
GoUctKnowledgeCombinationType.
GoKnowledgeCombinationType.
*/
class GoUctAdditiveKnowledgeMultiple: public GoAdditiveKnowledge
{
public:
GoUctAdditiveKnowledgeMultiple(const GoBoard& bd,
float minimum,
GoUctKnowledgeCombinationType
GoKnowledgeCombinationType
combinationType);

~GoUctAdditiveKnowledgeMultiple();
Expand All @@ -58,7 +58,7 @@ class GoUctAdditiveKnowledgeMultiple: public GoAdditiveKnowledge

float m_minimum;

GoUctKnowledgeCombinationType m_combinationType;
GoKnowledgeCombinationType m_combinationType;

const GoAdditiveKnowledge* FirstKnowledge() const;

Expand Down
14 changes: 7 additions & 7 deletions gouct/GoUctCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ std::vector<SgUctValue> KnowledgeThresholdFromString(const std::string& val)
return v;
}

std::string KnowledgeTypeToString(KnowledgeType type)
std::string GoKnowledgeTypeToString(GoKnowledgeType type)
{
switch (type)
{
Expand All @@ -218,7 +218,7 @@ std::string KnowledgeTypeToString(KnowledgeType type)
}
}

KnowledgeType KnowledgeTypeArg(const GtpCommand& cmd, size_t number)
GoKnowledgeType GoKnowledgeTypeArg(const GtpCommand& cmd, size_t number)
{
string arg = cmd.ArgToLower(number);
if (arg == "none")
Expand All @@ -231,10 +231,10 @@ KnowledgeType KnowledgeTypeArg(const GtpCommand& cmd, size_t number)
return KNOWLEDGE_FEATURES;
if (arg == "both")
return KNOWLEDGE_BOTH;
throw GtpFailure() << "unknown KnowledgeType argument \"" << arg << '"';
throw GtpFailure() << "unknown GoKnowledgeType argument \"" << arg << '"';
}

std::string CombinationTypeToString(GoUctKnowledgeCombinationType type)
std::string CombinationTypeToString(GoKnowledgeCombinationType type)
{
switch (type)
{
Expand All @@ -254,7 +254,7 @@ std::string CombinationTypeToString(GoUctKnowledgeCombinationType type)
}
}

GoUctKnowledgeCombinationType CombinationTypeArg(const GtpCommand& cmd,
GoKnowledgeCombinationType CombinationTypeArg(const GtpCommand& cmd,
size_t number)
{
string arg = cmd.ArgToLower(number);
Expand Down Expand Up @@ -783,7 +783,7 @@ void GoUctCommands::CmdParamPolicy(GtpCommand& cmd)
<< p.m_usePatternsInPriorKnowledge << '\n'
<< "[int] fillboard_tries " << p.m_fillboardTries << '\n'
<< "[list/none/greenpeep/rulebased/features/both] knowledge_type "
<< KnowledgeTypeToString(p.m_knowledgeType) << '\n'
<< GoKnowledgeTypeToString(p.m_knowledgeType) << '\n'
<< "[list/multiply/geometric_mean/add/average/max] "
"combination_type "
<< CombinationTypeToString(p.m_combinationType) << '\n'
Expand All @@ -806,7 +806,7 @@ void GoUctCommands::CmdParamPolicy(GtpCommand& cmd)
p.m_fillboardTries = cmd.Arg<int>(1);
else if (name == "knowledge_type")
{
p.m_knowledgeType = KnowledgeTypeArg(cmd, 1);
p.m_knowledgeType = GoKnowledgeTypeArg(cmd, 1);
Search().CreateThreads(); // need to regenerate all search states
}
else if (name == "combination_type")
Expand Down
2 changes: 1 addition & 1 deletion gouct/GoUctKnowledgeFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ GoAdditiveKnowledge* GoUctKnowledgeFactory::Create(const GoBoard& bd)
}

GoAdditiveKnowledge*
GoUctKnowledgeFactory::CreateByType(const GoBoard& bd, KnowledgeType type)
GoUctKnowledgeFactory::CreateByType(const GoBoard& bd, GoKnowledgeType type)
{
switch(type)
{
Expand Down
2 changes: 1 addition & 1 deletion gouct/GoUctKnowledgeFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class GoUctKnowledgeFactory

GoAdditiveKnowledge* Create(const GoBoard& bd);

GoAdditiveKnowledge* CreateByType(const GoBoard& bd, KnowledgeType type);
GoAdditiveKnowledge* CreateByType(const GoBoard& bd, GoKnowledgeType type);

GoUctAdditiveKnowledgeParamGreenpeep& GreenpeepParam();

Expand Down
4 changes: 2 additions & 2 deletions gouct/GoUctPlayoutPolicy.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ class GoUctPlayoutPolicyParam
float m_patternGammaThreshold;

/** To select knowledge type in GoUctKnowledgeFactory */
KnowledgeType m_knowledgeType;
GoKnowledgeType m_knowledgeType;

/** How to combine multiple additive knowledge */
GoUctKnowledgeCombinationType m_combinationType;
GoKnowledgeCombinationType m_combinationType;

GoUctPlayoutPolicyParam();
};
Expand Down
2 changes: 1 addition & 1 deletion gouct/test/GoUctAdditiveKnowledgeMultipleTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void Init(std::vector<SgUctMoveInfo>& moves, const GoBoard& bd)

void TestType(const GoBoard& bd,
std::vector<SgUctMoveInfo>& moves,
GoUctKnowledgeCombinationType combinationType,
GoKnowledgeCombinationType combinationType,
int nuKnowledge)
{
const SgUctValue minimum = 0.0001f;
Expand Down

0 comments on commit f816e8d

Please sign in to comment.