Package simulation

Class FastPopulationMember

java.lang.Object
simulation.Movable
simulation.PopulationMember
simulation.FastPopulationMember
All Implemented Interfaces:
Drawable

public class FastPopulationMember
extends PopulationMember
Class describing behaviour of fast PopulationMember.
  • Constructor Details

    • FastPopulationMember

      public FastPopulationMember​(Vector diameters)
      Creates new FastPopulationMember object with given diameters.
      Parameters:
      diameters - Vector containing size in pixels of this species.
    • FastPopulationMember

      public FastPopulationMember​(PopulationMember pm1, PopulationMember pm2)
      Create new object from crossover of 2 already existing objects.
      Parameters:
      pm1 - First object to be used in the crossover.
      pm2 - Second object to be used in the crossover.
  • Method Details

    • calcFitness

      public double calcFitness()
      Description copied from class: PopulationMember
      Calculate fitness of this object. Fitness is a value telling how good is genetic information of this object. The bigger the value the higher the chance of this species genetic information to survive.
      Specified by:
      calcFitness in class PopulationMember
      Returns:
      Fitness of this object.
    • draw

      public void draw​(javafx.scene.canvas.GraphicsContext gc)
      Description copied from interface: Drawable
      Function required to draw spmething on the screen.
      Parameters:
      gc - JavaFx object of class class used to issue draw calls to a Canvas using a buffer.