本文整理汇总了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;
}
示例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();
}
示例3: Factor
/// <inheritdoc />
public IGenome Factor(IGenome other)
{
var result = new EncogProgram(_context,
new EncogProgramVariables());
result.Copy(other);
return result;
}
示例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;
}
示例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;
}
示例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;
*/
}
示例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;
}
示例8: MateWorker
public MateWorker(IGenome theMother, IGenome theFather, IGenome theChild1, IGenome theChild2)
{
this._x405fa6c967740d37 = theMother;
this._xdb6cbc417cc4e418 = theFather;
this._xa7eb051c3211c54a = theChild1;
this._x76ad8378bdb66d70 = theChild2;
}
示例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);
}
}
示例10: Factor
/// <inheritdoc/>
public IGenome Factor(IGenome other)
{
MLMethodGenome result = (MLMethodGenome)Factor();
result.Copy(other);
result.Population = this.population;
return result;
}
示例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;
}
示例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];
}
}
示例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;
}
示例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;
}
示例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;
}