GeneticAlgorithm実装サービス jp.ossc.nimbus.service.ga.SimpleGeneticAlgorithmService

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世代内競争での各種の適応値の計算を並列化する。

以下に簡単なサービス定義を示します。

  1. <?xml version="1.0" encoding="Shift_JIS"?>
  2. <!DOCTYPE server PUBLIC
  3. "-//Nimbus//DTD Nimbus 1.0//JA"
  4. "http://nimbus.sourceforge.jp/dtd/nimbus-service_1_0.dtd">
  5. <server>
  6. <manager>
  7. <!-- 遺伝的アルゴリズムサービス-->
  8. <service name="GeneticAlgorithm"
  9. code="jp.ossc.nimbus.service.ga.SimpleGeneticAlgorithmService">
  10. <!-- 交叉対象となる個体の選択方式 -->
  11. <attribute name="SeedMatchMakerServiceName">#SeedMatchMaker</attribute>
  12. <!-- 収束条件 -->
  13. <attribute name="ConvergenceConditionServiceName">#ConvergenceCondition</attribute>
  14. <!-- 並列処理スレッド数 -->
  15. <attribute name="ParallelThreadNum">4</attribute>
  16. <depends>SeedMatchMaker</depends>
  17. <depends>ConvergenceCondition</depends>
  18. </service>
  19. <!-- 交叉対象となる個体の選択方式 -->
  20. <service name="SeedMatchMaker"
  21. code="jp.ossc.nimbus.service.ga.DefaultSeedMatchMakerService">
  22. <attribute name="EliteRate">0.05</attribute>
  23. <attribute name="DropRate">0.3</attribute>
  24. <attribute name="NewRate">0.01</attribute>
  25. <attribute name="MatchMakeMethod"><static-field-ref code="jp.ossc.nimbus.service.ga.DefaultSeedMatchMakerService" name="MATCH_MAKE_METHOD_ROULETTE"/></attribute>
  26. </service>
  27. <!-- 収束条件 -->
  28. <service name="ConvergenceCondition"
  29. code="jp.ossc.nimbus.service.ga.DefaultConvergenceConditionService">
  30. <attribute name="MaxGenerationNum">100</attribute>
  31. <attribute name="PreIndex">5</attribute>
  32. <attribute name="PermissibleRelativeError">0.01</attribute>
  33. </service>
  34. </manager>
  35. </server>


遺伝的アルゴリズム/GeneticAlgorithm