Gglazba
Class GAMelodija

java.lang.Object
  extended by Gglazba.GAMelodija

public class GAMelodija
extends java.lang.Object

Contains the genetic operators for the main melody genetic algorithm


Constructor Summary
Constructor and Description
GAMelodija()
           
 
Method Summary
Modifier and Type Method and Description
static Melodija krizanjeTockaPrekida(java.util.LinkedList<Melodija> odabrane)
          One-point crossover
static Melodija krizanjeUniformno(java.util.LinkedList<Melodija> odabrane)
          Uniform crossover
static Melodija mutacijaPromjeni(Melodija dijete)
          Mutation which changes tones for a half-step or whole-step up or down
static Melodija mutacijaZamjena(Melodija dijete)
          Mutation which switches places of two neighbouring tones
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GAMelodija

public GAMelodija()
Method Detail

krizanjeTockaPrekida

public static Melodija krizanjeTockaPrekida(java.util.LinkedList<Melodija> odabrane)
One-point crossover

Parameters:
odabrane - List of individuals who where chosen for the crossover
Returns:
The new individual created in the crossover

krizanjeUniformno

public static Melodija krizanjeUniformno(java.util.LinkedList<Melodija> odabrane)
Uniform crossover

Parameters:
odabrane - List of individuals who where chosen for the crossover
Returns:
The new individual created in the crossover

mutacijaZamjena

public static Melodija mutacijaZamjena(Melodija dijete)
Mutation which switches places of two neighbouring tones

Parameters:
dijete - The individual on which the mutation will be performed
Returns:
The mutated individual

mutacijaPromjeni

public static Melodija mutacijaPromjeni(Melodija dijete)
Mutation which changes tones for a half-step or whole-step up or down

Parameters:
dijete - The individual on which the mutation will be performed
Returns:
The mutated individual