feur
This commit is contained in:
parent
6c24966ca3
commit
db7919be94
4 changed files with 91 additions and 0 deletions
|
@ -4,6 +4,8 @@ public class Main {
|
|||
|
||||
public static void main(String[] args) {
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
69
src/main/java/fr/nabil/algogenetique/logique/Maze.java
Normal file
69
src/main/java/fr/nabil/algogenetique/logique/Maze.java
Normal 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;
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
package fr.nabil.algogenetique.logique;
|
||||
|
||||
public interface Simulation {
|
||||
|
||||
void evaluate();
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue