Skip to content

Commit bfd3575

Browse files
committed
added examples for ruggedness
1 parent e9035af commit bfd3575

File tree

4 files changed

+51
-3
lines changed

4 files changed

+51
-3
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ First, you need to add the following repository, which is a repository that can
3737
```
3838

3939
Than you can add the dependency on our `BBDOB_W_Model` repository into your `dependencies` section.
40-
Here, `1.0.4` is the current version of `BBDOB_W_Model`.
40+
Here, `1.0.5` is the current version of `BBDOB_W_Model`.
4141
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.
4242

4343
```xml
4444
<dependencies>
4545
<dependency>
4646
<groupId>com.github.thomasWeise</groupId>
4747
<artifactId>BBDOB_W_Model</artifactId>
48-
<version>1.0.4</version>
48+
<version>1.0.5</version>
4949
</dependency>
5050
</dependencies>
5151

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>cn.edu.hfuu.iao</groupId>
66
<artifactId>BBDOB_W_Model</artifactId>
7-
<version>1.0.4</version>
7+
<version>1.0.5</version>
88
<packaging>jar</packaging>
99
<name>BBDOB_W_Model</name>
1010
<description>The W-Model, a tunable Black-Box Discrete Optimization Benchmarking (BB-DOB) problem, implemented for the BB-DOB@GECCO Workshop.</description>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package cn.edu.hfuu.iao.WModel;
2+
3+
/** Here we reproduce the example given in our paper. */
4+
public class Ruggedness_Examples {
5+
6+
/**
7+
* The main routine
8+
*
9+
* @param args
10+
* the args (ignored)
11+
*/
12+
public static final void main(final String[] args) {
13+
14+
for (final int n : new int[] { 100, 500, 1000 }) {
15+
System.out.println("####################"); //$NON-NLS-1$
16+
System.out.print("n=" + n); //$NON-NLS-1$
17+
final int maxGamma = WModel_Ruggedness.max_gamma(n);
18+
System.out.println(", gamma in 0..." + maxGamma); //$NON-NLS-1$
19+
20+
System.out.println("gamma0\tgamma\tgamma'\tr[0]\tr[1]\t"); //$NON-NLS-1$
21+
22+
for (int gamma0I = 0; gamma0I <= 20; gamma0I++) {
23+
final double gamma0 = gamma0I / 20d;
24+
final int gamma = (int) (Math.round(//
25+
(maxGamma * gamma0I) / 20.0d));
26+
System.out.print(gamma0);
27+
System.out.print('\t');
28+
System.out.print(gamma);
29+
System.out.print('\t');
30+
System.out.print(
31+
WModel_Ruggedness.ruggedness_translate(gamma, n));
32+
for (final int i : WModel_Ruggedness.ruggedness(gamma,
33+
n)) {
34+
System.out.print('\t');
35+
System.out.print(i);
36+
}
37+
System.out.println();
38+
}
39+
System.out.println("####################"); //$NON-NLS-1$
40+
}
41+
}
42+
}

src/main/java/cn/edu/hfuu/iao/WModel/WModel_SingleObjective_DefaultInstances.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ public class WModel_SingleObjective_DefaultInstances {
4444
return result;
4545
}
4646

47+
/**
48+
* the main routine
49+
*
50+
* @param params
51+
* arguments
52+
*/
4753
public static final void main(final String[] params) {
4854
for (final Supplier<
4955
WModel_SingleObjective_Boolean> s : WModel_SingleObjective_DefaultInstances

0 commit comments

Comments
 (0)