Skip to content

Commit

Permalink
Enable serializable for the problems
Browse files Browse the repository at this point in the history
  • Loading branch information
chen0040 committed Jun 24, 2017
1 parent b0326a5 commit 2d865b5
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -19,7 +19,7 @@ Add the follow dependency to your POM file:
<dependency>
<groupId>com.github.chen0040</groupId>
<artifactId>java-moea</artifactId>
<version>1.0.4</version>
<version>1.0.5</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -6,7 +6,7 @@

<groupId>com.github.chen0040</groupId>
<artifactId>java-moea</artifactId>
<version>1.0.5</version>
<version>1.0.6</version>


<licenses>
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/github/chen0040/moea/problems/NDND.java
Expand Up @@ -11,6 +11,9 @@
* Created by xschen on 17/6/2017.
*/
public class NDND implements ProblemInstance {
private static final long serialVersionUID = 8627945754278982189L;


@Override public double getCost(Solution x, int objective_index) {

double f1 = 1 - Math.exp((-4) * x.get(0)) * Math.pow(Math.sin(5 * Math.PI * x.get(0)), 4);
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/github/chen0040/moea/problems/NGPD.java
Expand Up @@ -13,6 +13,8 @@
public class NGPD implements ProblemInstance {

private final static double M = 888888.0;
private static final long serialVersionUID = -8997395531572954837L;


@Override public double getCost(Solution x, int objective_index) {
if(objective_index==0)
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/github/chen0040/moea/problems/OKA2.java
Expand Up @@ -11,6 +11,9 @@
* Created by xschen on 17/6/2017.
*/
public class OKA2 implements ProblemInstance {
private static final long serialVersionUID = 6665004120372165596L;


@Override public double getCost(Solution x, int objective_index) {
double f=0;
switch(objective_index)
Expand Down
Expand Up @@ -3,13 +3,14 @@

import com.github.chen0040.moea.components.Solution;

import java.io.Serializable;
import java.util.List;


/**
* Created by xschen on 17/6/2017.
*/
public interface ProblemInstance {
public interface ProblemInstance extends Serializable {
double getCost(Solution x, int objective_index);


Expand Down
Expand Up @@ -16,6 +16,7 @@ public class SYMPART implements ProblemInstance {
private final static double a = 1;
private final static double b = 10;
private final static double c = 8;
private static final long serialVersionUID = -1412323130109052886L;
private double c1;
private double c2;
private double b1;
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/github/chen0040/moea/problems/TNK.java
Expand Up @@ -13,6 +13,8 @@
public class TNK implements ProblemInstance {

public static final double M = 888888.0;
private static final long serialVersionUID = -1673652070484478816L;


@Override
public double getCost(Solution x, int objective_index)
Expand Down

0 comments on commit 2d865b5

Please sign in to comment.