Gglazba
Class Operatori

java.lang.Object
  extended by Gglazba.Operatori

public class Operatori
extends java.lang.Object

Contains the tournament methods for this genetic algorithm


Constructor Summary
Constructor and Description
Operatori()
           
 
Method Summary
Modifier and Type Method and Description
static java.util.LinkedList<Melodija> izaberiNajMelodija(java.util.LinkedList<java.lang.Integer> izabrani, Melodija[] poljeMelodija)
          Selects 2 individuals for the crossover operator and one individual to be replaced by their child (for the main melody)
static java.util.LinkedList<Pratnja> izaberiNajPratnja(java.util.LinkedList<java.lang.Integer> izabrani, Pratnja[] poljePratnja)
          Selects 2 individuals for the crossover operator and one individual to be replaced by their child (for the accompanying melody)
static java.util.LinkedList<Ritam> izaberiNajRitmovi(java.util.LinkedList<java.lang.Integer> izabrani, Ritam[] poljeRitmova)
          Selects 2 individuals for the crossover operator and one individual to be replaced by their child (for the rhythm)
static java.util.LinkedList<java.lang.Integer> turnir(int velicinaTurnira, int velicinaPopulacije)
          Randomly selects individuals for the tournament from the population
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Operatori

public Operatori()
Method Detail

turnir

public static java.util.LinkedList<java.lang.Integer> turnir(int velicinaTurnira,
                                                             int velicinaPopulacije)
Randomly selects individuals for the tournament from the population

Parameters:
velicinaTurnira - Tournament size
velicinaPopulacije - Population size
Returns:
List of individuals selected for the tournament

izaberiNajRitmovi

public static java.util.LinkedList<Ritam> izaberiNajRitmovi(java.util.LinkedList<java.lang.Integer> izabrani,
                                                            Ritam[] poljeRitmova)
Selects 2 individuals for the crossover operator and one individual to be replaced by their child (for the rhythm)

Parameters:
izabrani - List of individuals chosen for the tournament
poljeRitmova - List of the rhythm population
Returns:
List of the two individuals chosen for the crossover operation, and the individual to be replaced

izaberiNajMelodija

public static java.util.LinkedList<Melodija> izaberiNajMelodija(java.util.LinkedList<java.lang.Integer> izabrani,
                                                                Melodija[] poljeMelodija)
Selects 2 individuals for the crossover operator and one individual to be replaced by their child (for the main melody)

Parameters:
izabrani - List of individuals chosen for the tournament
poljeMelodija - List of the main melody population
Returns:
List of the two individuals chosen for the crossover operation, and the individual to be replaced

izaberiNajPratnja

public static java.util.LinkedList<Pratnja> izaberiNajPratnja(java.util.LinkedList<java.lang.Integer> izabrani,
                                                              Pratnja[] poljePratnja)
Selects 2 individuals for the crossover operator and one individual to be replaced by their child (for the accompanying melody)

Parameters:
izabrani - List of individuals chosen for the tournament
poljePratnja - List of the accompanying melody population
Returns:
List of the two individuals chosen for the crossover operation, and the individual to be replaced