Exemplo n.º 1
0
 public Individual(FlightInstruction[] chromosome)
 {
     Chromosome = new FlightInstruction[chromosome.Length];
     for (int i = 0; i < chromosome.Length; i++)
     {
         Chromosome[i] = new FlightInstruction(chromosome[i].TiltAngle, chromosome[i].ThrustPower);
     }
 }
Exemplo n.º 2
0
 public Shuttle(Shuttle shuttle, Surface surface)
     : this(surface)
 {
     CurrentLocation          = new Point(shuttle.CurrentLocation.X, shuttle.CurrentLocation.Y);
     CurrentFlightInstruction = new FlightInstruction(shuttle.CurrentFlightInstruction.TiltAngle, shuttle.CurrentFlightInstruction.ThrustPower);
     HorizontalSpeed          = shuttle.HorizontalSpeed;
     VerticalSpeed            = shuttle.VerticalSpeed;
     RemainingFuel            = shuttle.RemainingFuel;
     FlightStatus             = shuttle.FlightStatus;
 }
Exemplo n.º 3
0
    private void EvalPopulation(Population population)
    {
        Parallel.ForEach(population.Individuals, individual =>
        {
            CalcFitness(individual);
        });

        population.PopulationFitness = 0;
        foreach (Individual individual in population.Individuals)
        {
            population.PopulationFitness += individual.Fitness;
        }

        EliteIndividual       = new Individual(population.GetFittest(0).Chromosome);
        BestFlightInstruction = new FlightInstruction(EliteIndividual.Chromosome[0]);
    }
Exemplo n.º 4
0
 public FlightInstruction(FlightInstruction flightInstruction)
 {
     TiltAngle   = flightInstruction.TiltAngle;
     ThrustPower = flightInstruction.ThrustPower;
 }