Skip to content

Commit

Permalink
added examples for ruggedness
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasWeise committed Mar 27, 2020
1 parent e9035af commit bfd3575
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ First, you need to add the following repository, which is a repository that can
```

Than you can add the dependency on our `BBDOB_W_Model` repository into your `dependencies` section.
Here, `1.0.4` is the current version of `BBDOB_W_Model`.
Here, `1.0.5` is the current version of `BBDOB_W_Model`.
Notice that you may have more dependencies in your `dependencies` section, say on `junit`, but here I just put the one for `aitoa-code` as example.

```xml
<dependencies>
<dependency>
<groupId>com.github.thomasWeise</groupId>
<artifactId>BBDOB_W_Model</artifactId>
<version>1.0.4</version>
<version>1.0.5</version>
</dependency>
</dependencies>

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>cn.edu.hfuu.iao</groupId>
<artifactId>BBDOB_W_Model</artifactId>
<version>1.0.4</version>
<version>1.0.5</version>
<packaging>jar</packaging>
<name>BBDOB_W_Model</name>
<description>The W-Model, a tunable Black-Box Discrete Optimization Benchmarking (BB-DOB) problem, implemented for the BB-DOB@GECCO Workshop.</description>
Expand Down
42 changes: 42 additions & 0 deletions src/main/java/cn/edu/hfuu/iao/WModel/Ruggedness_Examples.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package cn.edu.hfuu.iao.WModel;

/** Here we reproduce the example given in our paper. */
public class Ruggedness_Examples {

/**
* The main routine
*
* @param args
* the args (ignored)
*/
public static final void main(final String[] args) {

for (final int n : new int[] { 100, 500, 1000 }) {
System.out.println("####################"); //$NON-NLS-1$
System.out.print("n=" + n); //$NON-NLS-1$
final int maxGamma = WModel_Ruggedness.max_gamma(n);
System.out.println(", gamma in 0..." + maxGamma); //$NON-NLS-1$

System.out.println("gamma0\tgamma\tgamma'\tr[0]\tr[1]\t"); //$NON-NLS-1$

for (int gamma0I = 0; gamma0I <= 20; gamma0I++) {
final double gamma0 = gamma0I / 20d;
final int gamma = (int) (Math.round(//
(maxGamma * gamma0I) / 20.0d));
System.out.print(gamma0);
System.out.print('\t');
System.out.print(gamma);
System.out.print('\t');
System.out.print(
WModel_Ruggedness.ruggedness_translate(gamma, n));
for (final int i : WModel_Ruggedness.ruggedness(gamma,
n)) {
System.out.print('\t');
System.out.print(i);
}
System.out.println();
}
System.out.println("####################"); //$NON-NLS-1$
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ public class WModel_SingleObjective_DefaultInstances {
return result;
}

/**
* the main routine
*
* @param params
* arguments
*/
public static final void main(final String[] params) {
for (final Supplier<
WModel_SingleObjective_Boolean> s : WModel_SingleObjective_DefaultInstances
Expand Down

0 comments on commit bfd3575

Please sign in to comment.