演化仿真引擎 Evolve

MIT
Objective-C
iOS
2015-05-07
孔小菜

Evolve 是一个用 Objective-C 编写的演化仿真引擎。

示例代码:

- (void)evaluateFitnessForPopulation {    
NSArray *organisms = self.evolutionManager.population.organisms;    
for (Organism *organism in organisms) {        
   NSString *genomeString = organism.genome.sequence;        
   NSInteger geneSequenceLength = genomeString.length;        
   NSInteger correctCharacters = 0;        
   for (NSInteger charIndex = 0; 
      charIndex < geneSequenceLength; charIndex++) {            
      if ([genomeString characterAtIndex:charIndex] 
      == [kTargetString characterAtIndex:charIndex]) {
                correctCharacters++;
            }
        }

        organism.fitness = correctCharacters;
    }
}
加载中

评论(1)

西夏一品堂
西夏一品堂
演化仿真引擎 是干啥的?

暂无资讯

暂无问答

Unix command to find CPU Utilization

http://www.cyberciti.biz/faq/unix-command-to-find-cpu-utilization/ Task:Watching system activity evolve i.e. reports CPU Utilization # sar -u 12 5 Where, -u 12 5: Comparison of ...

2016/10/21 15:42
4
0
SCSI Standards Architecture

(*) This chart reflects the currently approved SCSI project family. T10 is responsible for all projects, except: IEEE is responsible for IEEE 1394; T11 responsible for Fibre Cha...

2012/10/24 11:40
70
0
Data Source Architectural Patterns

Data Source Architectural Patterns: Table Data Gateway (144), Row Data Gateway (152), Active Record (160), Data Mapper (165). Table Data Gateway An object that acts as a Gateway...

2014/03/03 09:35
14
0
filling technology continues to evolve

Bottle filling machine. The device is filled ampoules and vials. Its speed depends on the type of technology used. High quality ampoule filling machine, China Beverage Machinery...

2013/07/24 16:04
8
0
Entity Component System

http://t-machine.org/index.php/2007/09/03/entity-systems-are-the-future-of-mmog-development-part-1/ http://cowboyprogramming.com/2007/01/05/evolve-your-heirachy/ entity system o...

2014/05/28 11:29
172
0
EntitySystem

http://t-machine.org/index.php/2007/09/03/entity-systems-are-the-future-of-mmog-development-part-1/ http://cowboyprogramming.com/2007/01/05/evolve-your-heirachy/ entity system o...

2012/03/09 14:09
32
0
Linaro、ARM和它们的全Linux世界之路

摘要: Linaro(致力于为ARM架构开发开源软件的非盈利性组织)完全可以“控制基于ARM的智能终端和笔记本电脑的很大部分的生产,”评论员Robert Pogson表示。事实上,它可能是对Wintel 模式的...

2012/11/18 20:38
132
0
需要熟记的英语单词

predisposition

2014/12/15 20:17
190
0

没有更多内容

加载失败,请刷新页面

返回顶部
顶部