-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
2,040 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | ||
} |
18 changes: 18 additions & 0 deletions
18
opt4j-optimizers/src/main/java/org/opt4j/optimizers/ea/CouplerDefaultModule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
opt4j-optimizers/src/main/java/org/opt4j/optimizers/ea/CouplerModule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
opt4j-optimizers/src/main/java/org/opt4j/optimizers/ea/CouplerRandomModule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
opt4j-optimizers/src/main/java/org/opt4j/optimizers/ea/CouplerUniqueModule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.