Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented the Adaptive Epsilon Sampling EA #7

Merged
merged 37 commits into from
Jun 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
5c2fd7c
Implemented the basic structure of the survivor- and the mating-selec…
FedorSmirnov89 Mar 2, 2018
6e114f7
implemented tests for the adaptive epsilon sampling EA
FedorSmirnov89 Mar 3, 2018
4f14f94
Integrated the AeSeH into the EA Gui
FedorSmirnov89 Mar 4, 2018
5500531
separated the modules of NSGA and AeSeH; made AeSeH more flexible tow…
BossSeminarFAU Mar 7, 2018
069159a
fixed module bug
BossSeminarFAU Mar 7, 2018
9820bea
tests for AeSeH; addressed code smells of AeSeH
BossSeminarFAU Mar 8, 2018
24345a4
changed the way the sampling accesses objective values to cope with n…
BossSeminarFAU Mar 9, 2018
519c44d
fixed the value access for the epsilon mapping function
BossSeminarFAU Mar 9, 2018
4608ebc
refactored the non-dominated sorting
BossSeminarFAU Mar 9, 2018
5e5e392
Merge branch 'eps_sampling_ea'
BossSeminarFAU Mar 9, 2018
a17788f
fixed typos
FedorSmirnov89 Mar 11, 2018
0551a69
added a check for infeasible objectives; adjusted the test cases acco…
FedorSmirnov89 Mar 11, 2018
03e83db
created an extra package for the classes of the AeSeH MOEA
BossSeminarFAU Mar 16, 2018
051805b
moved the tests to the new package as well
BossSeminarFAU Mar 16, 2018
c5a6b87
restored the build.gradle file
BossSeminarFAU Mar 16, 2018
35e74a6
Implemented non dominated sorting in a non-static way
BossSeminarFAU Mar 16, 2018
fb152ff
forgot to add stuff before committing
BossSeminarFAU Mar 16, 2018
8291485
changed the build to get mockito from maven
BossSeminarFAU Mar 16, 2018
9297324
cleaned up the comments
BossSeminarFAU Mar 16, 2018
dabe519
fixed infeasible objectives bug
BossSeminarFAU Mar 19, 2018
7b31949
Merge https://github.com/felixreimann/opt4j
BossSeminarFAU Mar 21, 2018
4c52546
used the citation-annotation and removed the comments
BossSeminarFAU Mar 21, 2018
ae3866f
improved javadoc comments
BossSeminarFAU Mar 22, 2018
e22b575
Merge https://github.com/felixreimann/opt4j
BossSeminarFAU Apr 4, 2018
3c9b0a1
updated class names and package description
BossSeminarFAU Apr 19, 2018
1bf72d1
changed the module structure
BossSeminarFAU Apr 19, 2018
9a47452
minor corrections + implemented a coupler module for the gui
FedorSmirnov89 May 5, 2018
3084c0f
refactored code so that the coupler and the selecotor can be used ind…
FedorSmirnov89 May 10, 2018
16432a8
restructured the coupler- and selector modules
FedorSmirnov89 May 11, 2018
dbbbae7
merge with the main repository version
FedorSmirnov89 May 11, 2018
61a914d
implemented the changes requested in the review
FedorSmirnov89 Jun 3, 2018
e9e6d7b
added new lines at the end of files
BossSeminarFAU Jun 11, 2018
7dc0c88
Merge branch 'master' of https://github.com/FedorSmirnovUdacity/opt4j
BossSeminarFAU Jun 11, 2018
48a85e5
typo
Jun 12, 2018
5750f19
Update EpsilonSamplingSelectorModule.java
Jun 12, 2018
3396503
see comment
Jun 12, 2018
ef6eb5e
phrase removed
Jun 12, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
bin
build

# Temporary files created when working on Linux
*~

# Eclipse files are created with `gradlew eclipse`
.classpath
.project
Expand Down
3 changes: 3 additions & 0 deletions opt4j-optimizers/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
dependencies {
compile project(':opt4j-core')
compile project(':opt4j-operators')

testCompile group: 'junit', name: 'junit', version: '[4.0,)'
testCompile group: 'org.mockito', name: 'mockito-all', version: '1.9.5'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package org.opt4j.optimizers.ea;

import org.opt4j.core.config.annotations.Name;

/**
* Binds the {@link CouplerDefault} as the {@link Coupler}.
*
* @author Fedor Smirnov
*
*/
@Name("Default")
public class CouplerDefaultModule extends CouplerModule {

@Override
protected void config() {
bindCoupler(CouplerDefault.class);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package org.opt4j.optimizers.ea;

import org.opt4j.core.config.Icons;
import org.opt4j.core.config.annotations.Category;
import org.opt4j.core.config.annotations.Icon;
import org.opt4j.core.config.annotations.Parent;
import org.opt4j.core.start.Opt4JModule;

/**
* Abstract module class for the {@link Coupler}.
*
* @author Fedor Smirnov
*
*/
@Icon(Icons.SELECTOR)
@Category
@Parent(EvolutionaryAlgorithmModule.class)
public abstract class CouplerModule extends Opt4JModule {

/**
* Binds the given {@link Coupler}.
*
* @param coupler
* the {@link Coupler} to bind
*/
protected void bindCoupler(Class<? extends Coupler> coupler) {
bind(Coupler.class).to(coupler).in(SINGLETON);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package org.opt4j.optimizers.ea;

import org.opt4j.core.config.annotations.Name;

/**
* Binds the {@link CouplerRandom} as the {@link Coupler}.
*
* @author Fedor Smirnov
*
*/
@Name("Random")
public class CouplerRandomModule extends CouplerModule {

@Override
protected void config() {
bindCoupler(CouplerRandom.class);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package org.opt4j.optimizers.ea;

import org.opt4j.core.config.annotations.Name;

/**
* Binds the {@link CouplerUnique} as the {@link Coupler}.
*
* @author Fedor Smirnov
*
*/
@Name("Unique")
public class CouplerUniqueModule extends CouplerModule {

@Override
protected void config() {
bindCoupler(CouplerUnique.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*******************************************************************************/


package org.opt4j.optimizers.ea;

Expand Down Expand Up @@ -47,19 +46,19 @@ public class EvolutionaryAlgorithmModule extends OptimizerModule {
protected int generations = 1000;

@Constant(value = "alpha", namespace = EvolutionaryAlgorithm.class)
@Info("The size of the population.")
@Info("The size of the population α.")
@Order(1)
protected int alpha = 100;
protected int populationSize = 100;

@Constant(value = "mu", namespace = EvolutionaryAlgorithm.class)
@Info("The number of parents per generation.")
@Info("The number of parents per generation μ.")
@Order(2)
protected int mu = 25;
protected int parentsPerGeneration = 25;

@Constant(value = "lambda", namespace = EvolutionaryAlgorithm.class)
@Info("The number of offspring per generation.")
@Info("The number of offsprings per generation λ.")
@Order(3)
protected int lambda = 25;
protected int offspringsPerGeneration = 25;

@Info("Performs a crossover operation with this given rate.")
@Order(4)
Expand All @@ -86,28 +85,25 @@ public enum CrossoverRateType {
/**
* Returns the population size {@code alpha}.
*
* @see #setAlpha
* @return the population size
*/
public int getAlpha() {
return alpha;
public int getPopulationSize() {
return populationSize;
}

/**
* Sets the population size {@code alpha}.
*
* @see #getAlpha
* @param alpha
* the population size to set
*/
public void setAlpha(int alpha) {
this.alpha = alpha;
public void setPopulationSize(int alpha) {
this.populationSize = alpha;
}

/**
* Returns the number of generations.
*
* @see #setGenerations
* @return the number of generations
*/
public int getGenerations() {
Expand All @@ -128,49 +124,44 @@ public void setGenerations(int generations) {
/**
* Returns the number of children {@code lambda}.
*
* @see #setLambda
* @return the number of children
*/
public int getLambda() {
return lambda;
public int getOffspringsPerGeneration() {
return offspringsPerGeneration;
}

/**
* Sets the number of children {@code lambda}.
*
* @see #getLambda
* @param lambda
* the number of children
*/
public void setLambda(int lambda) {
this.lambda = lambda;
public void setOffspringsPerGeneration(int lambda) {
this.offspringsPerGeneration = lambda;
}

/**
* Returns the number of parents {@code mu}.
*
* @see #setMu
* @return the number of parents
*/
public int getMu() {
return mu;
public int getParentsPerGeneration() {
return parentsPerGeneration;
}

/**
* Sets the number of parents {@code mu}.
*
* @see #getMu
* @param mu
* the number of parents
*/
public void setMu(int mu) {
this.mu = mu;
public void setParentsPerGeneration(int mu) {
this.parentsPerGeneration = mu;
}

/**
* Returns the type of crossover rate that is used.
*
* @see #setCrossoverRateType
* @return the crossoverRateType
*/
public CrossoverRateType getCrossoverRateType() {
Expand All @@ -180,7 +171,6 @@ public CrossoverRateType getCrossoverRateType() {
/**
* Sets the type of crossover rate to use.
*
* @see #getCrossoverRateType
* @param crossoverRateType
* the crossoverRateType to set
*/
Expand All @@ -191,7 +181,6 @@ public void setCrossoverRateType(CrossoverRateType crossoverRateType) {
/**
* Returns the used crossover rate.
*
* @see #setCrossoverRate
* @return the crossoverRate
*/
public double getCrossoverRate() {
Expand All @@ -201,7 +190,6 @@ public double getCrossoverRate() {
/**
* Sets the crossover rate.
*
* @see #getCrossoverRate
* @param crossoverRate
* the crossoverRate to set
*/
Expand All @@ -216,9 +204,7 @@ public void setCrossoverRate(double crossoverRate) {
*/
@Override
public void config() {

bindIterativeOptimizer(EvolutionaryAlgorithm.class);

bind(CrossoverRate.class).to(ConstantCrossoverRate.class).in(SINGLETON);
}
}