当前位置: 首页>>代码示例>>C#>>正文


C# IGenome类代码示例

本文整理汇总了C#中IGenome的典型用法代码示例。如果您正苦于以下问题:C# IGenome类的具体用法?C# IGenome怎么用?C# IGenome使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IGenome类属于命名空间,在下文中一共展示了IGenome类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ParallelScoreTask

 /// <summary>
 ///     Construct the parallel task.
 /// </summary>
 /// <param name="genome">The genome.</param>
 /// <param name="theOwner">The owner.</param>
 public ParallelScoreTask(IGenome genome, ParallelScore theOwner)
 {
     owner = theOwner;
     this.genome = genome;
     scoreFunction = theOwner.ScoreFunction;
     adjusters = theOwner.Adjusters;
 }
开发者ID:johannsutherland,项目名称:encog-dotnet-core,代码行数:12,代码来源:ParallelScoreTask.cs

示例2: setGenomeLog

 /// <summary>
 /// Record a unique genome
 /// </summary>
 /// <param name="genome">genome to be record</param>
 public void setGenomeLog(IGenome genome)
 {
     xtw.WriteStartElement("Genome");
     xtw.WriteAttributeString("Value", genome.ToString());
     xtw.WriteAttributeString("Fitness", genome.Evaluate().ToString());
     xtw.WriteEndElement();
 }
开发者ID:Raguze,项目名称:evolvedotnet,代码行数:11,代码来源:GenerationLog.cs

示例3: Factor

 /// <inheritdoc />
 public IGenome Factor(IGenome other)
 {
     var result = new EncogProgram(_context,
                                   new EncogProgramVariables());
     result.Copy(other);
     return result;
 }
开发者ID:CreativelyMe,项目名称:encog-dotnet-core,代码行数:8,代码来源:PrgGenomeFactory.cs

示例4: Copy

 /// <inheritdoc />
 public override void Copy(IGenome source)
 {
     var sourceDouble = (DoubleArrayGenome) source;
     Array.Copy(sourceDouble._data, _data, _data.Length);
     Score = source.Score;
     AdjustedScore = source.AdjustedScore;
 }
开发者ID:Raghavendra1509,项目名称:aifh,代码行数:8,代码来源:DoubleArrayGenome.cs

示例5: Copy

 /// <inheritdoc />
 public override void Copy(IGenome source)
 {
     var sourceInt = (IntegerArrayGenome) source;
     Array.Copy(sourceInt._data, _data, _data.Length);
     Score = source.Score;
     AdjustedScore = source.AdjustedScore;
 }
开发者ID:Raghavendra1509,项目名称:aifh,代码行数:8,代码来源:IntegerArrayGenome.cs

示例6: Cross

        public virtual void Cross(IGenome genome1, IGenome genome2)
        {
            SelectionGenome sGenome1 = (SelectionGenome) genome1;
            SelectionGenome sGenome2 = (SelectionGenome) genome2;

            SelectionCrossover(sGenome1, sGenome2);

            sGenome1.InstructionGraph     = null;
            sGenome1.RegisterAssignment   = null;
            sGenome1.InstructionSchedule  = null;
            sGenome1.Modified = true;

            /*
            sGenome1.BestSchedulingGenome = null;
            */

            sGenome2.InstructionGraph     = null;
            sGenome2.RegisterAssignment   = null;
            sGenome2.InstructionSchedule  = null;
            sGenome2.Modified = true;

            /*
            sGenome2.BestSchedulingGenome = null;
            */
        }
开发者ID:harnold,项目名称:cobe,代码行数:25,代码来源:SelectionGenomeCrossover.cs

示例7: Mutate

        public virtual void Mutate(IGenome genome, double pMutation)
        {
            SchedulingGenome sGenome = (SchedulingGenome) genome;

            bool mutated = false;

            if (GA.Random.NextDouble() < pScheduleMutation) {
                ScheduleMutation(sGenome);
                mutated = true;
            }

            if (GA.Random.NextDouble() < pRegisterMutation) {
                RegisterMutation(sGenome);
                mutated = true;
            }

            if (GA.Random.NextDouble() < pScheduleCrossSwap) {
                ScheduleCrossSwap(sGenome);
                mutated = true;
            }

            if (GA.Random.NextDouble() < pScheduleCompaction) {
                ScheduleCompaction(sGenome);
                mutated = true;
            }

            if (mutated)
                sGenome.GenerationOfBirth = sGenome.Population.GA.Generation;
        }
开发者ID:harnold,项目名称:cobe,代码行数:29,代码来源:SchedulingGenomeMutation.cs

示例8: MateWorker

 public MateWorker(IGenome theMother, IGenome theFather, IGenome theChild1, IGenome theChild2)
 {
     this._x405fa6c967740d37 = theMother;
     this._xdb6cbc417cc4e418 = theFather;
     this._xa7eb051c3211c54a = theChild1;
     this._x76ad8378bdb66d70 = theChild2;
 }
开发者ID:neismit,项目名称:emds,代码行数:7,代码来源:MateWorker.cs

示例9: PerformOperation

        /// <inheritdoc/>
        public override void PerformOperation(EncogRandom rnd, IGenome[] parents,
                int parentIndex, IGenome[] offspring,
                int offspringIndex)
        {
            var target = ObtainGenome(parents, parentIndex, offspring,
                    offspringIndex);

            if (target.LinksChromosome.Count < MinLink)
            {
                // don't remove from small genomes
                return;
            }

            // determine the target and remove
            var index = RangeRandomizer.RandomInt(0, target
                    .LinksChromosome.Count - 1);
            NEATLinkGene targetGene = target.LinksChromosome[index];
            target.LinksChromosome.Remove(targetGene);

            // if this orphaned any nodes, then kill them too!
            if (!IsNeuronNeeded(target, targetGene.FromNeuronId))
            {
                RemoveNeuron(target, targetGene.FromNeuronId);
            }

            if (!IsNeuronNeeded(target, targetGene.ToNeuronId))
            {
                RemoveNeuron(target, targetGene.ToNeuronId);
            }
        }
开发者ID:johannsutherland,项目名称:encog-dotnet-core,代码行数:31,代码来源:NEATMutateRemoveLink.cs

示例10: Factor

 /// <inheritdoc/>
 public IGenome Factor(IGenome other)
 {
     MLMethodGenome result = (MLMethodGenome)Factor();
     result.Copy(other);
     result.Population = this.population;
     return result;
 }
开发者ID:johannsutherland,项目名称:encog-dotnet-core,代码行数:8,代码来源:MLMethodGenomeFactory.cs

示例11: Decode

 public IMLMethod Decode(IGenome genome)
 {
     var result = new RBFNetwork(_inputCount, _rbfCount, _outputCount);
     var dag = (DoubleArrayGenome) genome;
     Array.Copy(dag.Data, 0, result.LongTermMemory, 0, _size);
     return result;
 }
开发者ID:Raghavendra1509,项目名称:aifh,代码行数:7,代码来源:RBFNetworkGenomeCODEC.cs

示例12: Mutate

 /// <summary>
 /// Execute Mutation in the genome for reference with based in the rate
 /// </summary>
 /// <param name="genome">Genome</param>
 public void Mutate(IGenome genome)
 {
     if (Helper.Random.NextDouble() < RateMutation)
     {
         int locus = Helper.Random.Next(genome.Length);
         genome[locus] = !genome[locus];
     }
 }
开发者ID:Raguze,项目名称:evolvedotnet,代码行数:12,代码来源:RandomMutation.cs

示例13: MateWorker

 /// <param name="theMother">The mother.</param>
 /// <param name="theFather">The father.</param>
 /// <param name="theChild1">The first child.</param>
 /// <param name="theChild2">The second child.</param>
 public MateWorker(IGenome theMother, IGenome theFather,
                   IGenome theChild1, IGenome theChild2)
 {
     _mother = theMother;
     _father = theFather;
     _child1 = theChild1;
     _child2 = theChild2;
 }
开发者ID:encog,项目名称:encog-silverlight-core,代码行数:12,代码来源:MateWorker.cs

示例14: MateWorker

 /// <summary>
 /// Create a MateWorker.
 /// </summary>
 /// <param name="mother">The mother.</param>
 /// <param name="father">The father.</param>
 /// <param name="child1">The first child.</param>
 /// <param name="child2">The second child.</param>
 public MateWorker(IGenome mother, IGenome father,
         IGenome child1, IGenome child2)
 {
     this.mother = mother;
     this.father = father;
     this.child1 = child1;
     this.child2 = child2;
 }
开发者ID:OperatorOverload,项目名称:encog-cs,代码行数:15,代码来源:MateWorker.cs

示例15: GetCompatibilityScore

 /// <inheritdoc />
 public override double GetCompatibilityScore(IGenome genome1,
                                              IGenome genome2)
 {
     var comp = new CompareEncogProgram();
     double d = comp.Compare((EncogProgram) genome1,
                             (EncogProgram) genome2);
     return d;
 }
开发者ID:CreativelyMe,项目名称:encog-dotnet-core,代码行数:9,代码来源:PrgSpeciation.cs


注:本文中的IGenome类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。