nimbus (1.2.4) | 2018-01-25 20:02 |
nimbus-sample (1.2.4) | 2018-01-26 17:06 |
jp.ossc.nimbus.service.ga.SimpleGeneticAlgorithmServiceは、与えられた種から世代を作り、世代内競争をさせた後、世代内で交配をして次世代を作り競争させる事を繰り返し、生き残った種の適応値を見て種から収束判定をして優秀な種を取り出す遺伝的アルゴリズムを体現するjp.ossc.nimbus.service.ga.GeneticAlgorithm実装サービスです。
このサービスは、複合的なサービスで、以下のサービスを下位サービスとして使用します。
下位サービスインタフェース | 用途 |
jp.ossc.nimbus.service.ga.SeedMatchMaker | 世代内で種を交配させる。 |
jp.ossc.nimbus.service.ga.ConvergenceCondition | 生き残った種の適応値を判断して、最終世代を決定する。 |
jp.ossc.nimbus.service.queue.QueueHandlerContainer | 世代内競争での各種の適応値の計算を並列化する。 |
以下に簡単なサービス定義を示します。
- <?xml version="1.0" encoding="Shift_JIS"?>
- <!DOCTYPE server PUBLIC
- "-//Nimbus//DTD Nimbus 1.0//JA"
- "http://nimbus.sourceforge.jp/dtd/nimbus-service_1_0.dtd">
- <server>
- <manager>
- <!-- 遺伝的アルゴリズムサービス-->
- <service name="GeneticAlgorithm"
- code="jp.ossc.nimbus.service.ga.SimpleGeneticAlgorithmService">
- <!-- 交叉対象となる個体の選択方式 -->
- <attribute name="SeedMatchMakerServiceName">#SeedMatchMaker</attribute>
- <!-- 収束条件 -->
- <attribute name="ConvergenceConditionServiceName">#ConvergenceCondition</attribute>
- <!-- 並列処理スレッド数 -->
- <attribute name="ParallelThreadNum">4</attribute>
- <depends>SeedMatchMaker</depends>
- <depends>ConvergenceCondition</depends>
- </service>
- <!-- 交叉対象となる個体の選択方式 -->
- <service name="SeedMatchMaker"
- code="jp.ossc.nimbus.service.ga.DefaultSeedMatchMakerService">
- <attribute name="EliteRate">0.05</attribute>
- <attribute name="DropRate">0.3</attribute>
- <attribute name="NewRate">0.01</attribute>
- <attribute name="MatchMakeMethod"><static-field-ref code="jp.ossc.nimbus.service.ga.DefaultSeedMatchMakerService" name="MATCH_MAKE_METHOD_ROULETTE"/></attribute>
- </service>
- <!-- 収束条件 -->
- <service name="ConvergenceCondition"
- code="jp.ossc.nimbus.service.ga.DefaultConvergenceConditionService">
- <attribute name="MaxGenerationNum">100</attribute>
- <attribute name="PreIndex">5</attribute>
- <attribute name="PermissibleRelativeError">0.01</attribute>
- </service>
- </manager>
- </server>