GoUctAdditiveKnowledge* GoUctKnowledgeFactory::Create(const GoBoard& bd) { KnowledgeType type = m_param.m_knowledgeType; switch(type) { case KNOWLEDGE_NONE: return 0; case KNOWLEDGE_GREENPEEP: return new GoUctAdditiveKnowledgeGreenpeep(bd, GreenpeepParam()); break; case KNOWLEDGE_RULEBASED: return new GoUctAdditiveKnowledgeFuego(bd); break; case KNOWLEDGE_BOTH: { GoUctAdditiveKnowledgeFuego* f = new GoUctAdditiveKnowledgeFuego(bd); SgUctValue scale = f->Scale(); SgUctValue minimum = f->Minimum(); GoUctAdditiveKnowledgeMultiple* m = new GoUctAdditiveKnowledgeMultiple(bd, scale, minimum, m_param.m_combinationType); m->AddKnowledge(f); m->AddKnowledge( new GoUctAdditiveKnowledgeGreenpeep(bd, GreenpeepParam())); return m; } break; default: SG_ASSERT(false); return 0; } }
GoAdditiveKnowledge* GoUctKnowledgeFactory::CreateByType(const GoBoard& bd, KnowledgeType type) { switch(type) { case KNOWLEDGE_NONE: return 0; case KNOWLEDGE_GREENPEEP: return new GoUctAdditiveKnowledgeGreenpeep(bd, GreenpeepParam()); break; case KNOWLEDGE_RULEBASED: return new GoUctAdditiveKnowledgeFuego(bd); break; case KNOWLEDGE_FEATURES: return m_featureKnowledgeFactory.Create(bd); break; case KNOWLEDGE_BOTH: { GoUctAdditiveKnowledgeFuego* f = new GoUctAdditiveKnowledgeFuego(bd); float minimum = f->MinValue(); GoUctAdditiveKnowledgeMultiple* m = new GoUctAdditiveKnowledgeMultiple(bd, minimum, m_param.m_combinationType); m->AddKnowledge(f); m->AddKnowledge( new GoUctAdditiveKnowledgeGreenpeep(bd, GreenpeepParam())); return m; } break; default: SG_ASSERT(false); return 0; } }