Skip to content

Commit

Permalink
fixed UMDA for JSSP
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasWeise committed Apr 26, 2020
1 parent 205890c commit f27bab2
Show file tree
Hide file tree
Showing 14 changed files with 114 additions and 691 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ First, you need to add the following repository, which is a repository that can
```

Than you can add the dependency on our `aitoa-code` repository into your `dependencies` section.
Here, `0.8.53` is the current version of `aitoa-code`.
Here, `0.8.54` is the current version of `aitoa-code`.
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>aitoa-code</artifactId>
<version>0.8.53</version>
<version>0.8.54</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 @@ -5,7 +5,7 @@

<groupId>aitoa</groupId>
<artifactId>aitoa-code</artifactId>
<version>0.8.53</version>
<version>0.8.54</version>
<packaging>jar</packaging>
<name>aitoa-code</name>
<description>Example Source Codes from the Book "Introduction to Optimization Algorithms"</description>
Expand Down
70 changes: 60 additions & 10 deletions src/main/java/aitoa/examples/jssp/EJSSPExperimentStage.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import aitoa.algorithms.HillClimber2;
import aitoa.algorithms.HillClimber2WithRestarts;
import aitoa.algorithms.HillClimberWithRestarts;
import aitoa.algorithms.HybridEDA;
import aitoa.algorithms.MA;
import aitoa.algorithms.MAWithClearing;
import aitoa.algorithms.RandomSampling;
Expand Down Expand Up @@ -508,19 +509,68 @@ public void configureBuilderForProblem(
IMetaheuristic<int[], JSSPCandidateSolution>>>
getAlgorithms(//
final JSSPMakespanObjectiveFunction problem) {

final ArrayList<Supplier<
IMetaheuristic<int[], JSSPCandidateSolution>>> list =
new ArrayList<>();
for (int i = 10; i <= 16; i++) {
final int lambda = (1 << i);
for (int j = 6; j <= 8; j++) {
final int mu = lambda / (1 << j);
list.add(() -> new EDA<>(mu, lambda, //
new JSSPUMDAModel(problem.instance)));
list.add(() -> new EDA<>(mu, lambda, //
new JSSPSpreadModel(problem.instance, 16)));
}
}

list.add(() -> new EDA<>(1, 1 << 5, //
new JSSPUMDAModel(problem.instance, 64L)));
list.add(() -> new EDA<>(2, 1 << 5, //
new JSSPUMDAModel(problem.instance, 32L)));

list.add(() -> new EDA<>(1, 1 << 10, //
new JSSPUMDAModel(problem.instance, 64L)));
list.add(() -> new EDA<>(2, 1 << 10, //
new JSSPUMDAModel(problem.instance, 32L)));

list.add(() -> new EDA<>(1, 1 << 15, //
new JSSPUMDAModel(problem.instance, 64L)));
list.add(() -> new EDA<>(2, 1 << 15, //
new JSSPUMDAModel(problem.instance, 32L)));

return list.stream();
}
},

/**
* the twelfth stage: estimation of distribution algorithm with
* local search
*/
STAGE_12 {

/**
* Get a stream of algorithm suppliers for a given problem
*
* @param problem
* the problem
* @return the stream of suppliers
*/
@Override
public
Stream<Supplier<
IMetaheuristic<int[], JSSPCandidateSolution>>>
getAlgorithms(//
final JSSPMakespanObjectiveFunction problem) {

final ArrayList<Supplier<
IMetaheuristic<int[], JSSPCandidateSolution>>> list =
new ArrayList<>();

list.add(() -> new HybridEDA<>(1, 16, Integer.MAX_VALUE, //
new JSSPUMDAModel(problem.instance, 64L)));
list.add(() -> new HybridEDA<>(2, 16, Integer.MAX_VALUE, //
new JSSPUMDAModel(problem.instance, 32L)));
list.add(() -> new HybridEDA<>(4, 16, Integer.MAX_VALUE, //
new JSSPUMDAModel(problem.instance, 16L)));

list.add(() -> new HybridEDA<>(1, 32, Integer.MAX_VALUE, //
new JSSPUMDAModel(problem.instance, 64L)));
list.add(() -> new HybridEDA<>(2, 32, Integer.MAX_VALUE, //
new JSSPUMDAModel(problem.instance, 32L)));
list.add(() -> new HybridEDA<>(4, 32, Integer.MAX_VALUE, //
new JSSPUMDAModel(problem.instance, 16L)));

return list.stream();
}
};
Expand Down

0 comments on commit f27bab2

Please sign in to comment.