public SIMONIntelligence(AlgorithmForAI algorithm, SIMONAlgorithm algorithmCls, AsyncCallback learnCallback) { IntelligenceAlgorithm = algorithm; AlgorithmPerformer = algorithmCls; AlgorithmInvoker = new AlgorithmDelegate(AlgorithmPerformer.Implementation); AlgorithmLearnInvoker = new AlgorithmLearningDelegate(AlgorithmPerformer.Implementation); AlgorithmLearnPropInvoker = new AlgorithmLearnPropDelegate(AlgorithmPerformer.Implementation); LearnCallbackInvoker = new AsyncCallback(learnCallback); LearnPropCallbackInvoker = new AsyncCallback(LearnPropertyAsyncCallback); LearnResult = null; }
/// <summary> /// 설정된 AI 알고리즘 클래스에 알려져있는 형태의 옵션 정보를 설정합니다. /// </summary> /// <param name="algorithm">SIMONFramework 내에 등록된 AI Algorithm 클래스입니다.</param> /// <param name="optionParam">AI Algorithm 클래스 내의 설정에 대한 정보를 갖는 옵션 클래스입니다.</param> public void ConfigureLearning(AlgorithmForAI algorithm, object optionParam) { switch (algorithm) { case AlgorithmForAI.GENETIC: ((SIMONGeneticAlgorithm)AlgorithmPerformer).SetMutationChance(((SIMONGeneticAlgorithm.GeneOption)optionParam).mutationChance); ((SIMONGeneticAlgorithm)AlgorithmPerformer).SetMutationProportion(((SIMONGeneticAlgorithm.GeneOption)optionParam).mutationProportion); break; case AlgorithmForAI.NEURALNETWORK: break; default: throw new Exception("[SIMONIntelligence] : Invalid Algorithm class implementation."); } }
/// <summary> /// 설정된 AI 알고리즘 클래스에 알려져있는 형태의 옵션 정보를 설정합니다. /// </summary> /// <param name="algorithm">SIMONFramework 내에 등록된 AI Algorithm 클래스입니다.</param> /// <param name="optionParam">AI Algorithm 클래스 내의 설정에 대한 정보를 갖는 옵션 클래스입니다.</param> public void ConfigureLearning(AlgorithmForAI algorithm, object optionParam) { switch (algorithm) { case AlgorithmForAI.GENETIC: ((SIMONGeneticAlgorithm)AlgorithmPerformer).SetMutationChance(((SIMONGeneticAlgorithm.GeneOption)optionParam).mutationChance); ((SIMONGeneticAlgorithm)AlgorithmPerformer).SetMutationProportion(((SIMONGeneticAlgorithm.GeneOption)optionParam).mutationProportion); break; case AlgorithmForAI.NEURALNETWORK: //Not Supported Yet. break; default: throw new SIMONFramework.InvalidAlgorithmClassException(SIMONConstants.EXP_INVALID_ALGORITHM_CLS); } }