This commit is contained in:
Nabil Ould Hamou 2024-10-11 20:11:19 +02:00
parent 6c24966ca3
commit db7919be94
4 changed files with 91 additions and 0 deletions

View file

@ -4,6 +4,8 @@ public class Main {
public static void main(String[] args) {
}
}

View file

@ -0,0 +1,69 @@
package fr.nabil.algogenetique.logique;
public class Maze implements Simulation {
private int[][] maze = {
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1},
};
private int populationSize;
private int iterations;
private float mutation;
private float crossover;
private float elitism;
public Maze(int populationSize, int iterations, float mutation, float crossover, float elitism) {
this.populationSize = populationSize;
this.iterations = iterations;
this.mutation = mutation;
this.crossover = crossover;
this.elitism = elitism;
}
public void evaluate() {
}
public int getPopulationSize() {
return populationSize;
}
public void setPopulationSize(int populationSize) {
this.populationSize = populationSize;
}
public int getIterations() {
return iterations;
}
public void setIterations(int iterations) {
this.iterations = iterations;
}
public float getMutation() {
return mutation;
}
public void setMutation(float mutation) {
this.mutation = mutation;
}
public float getCrossover() {
return crossover;
}
public void setCrossover(float crossover) {
this.crossover = crossover;
}
public float getElitism() {
return elitism;
}
public void setElitism(float elitism) {
this.elitism = elitism;
}
}

View file

@ -6,6 +6,19 @@ public class Population {
private BitSet chromosome;
public Population() {
this.chromosome = new BitSet();
}
public Population(BitSet chromosome) {
this.chromosome = chromosome;
}
public BitSet getChromosome() {
return chromosome;
}
public void setChromosome(BitSet chromosome) {
this.chromosome = chromosome;
}
}

View file

@ -0,0 +1,7 @@
package fr.nabil.algogenetique.logique;
public interface Simulation {
void evaluate();
}