Skip to content

Commit

Permalink
FIxed a bug when creating feasible solutions
Browse files Browse the repository at this point in the history
  • Loading branch information
Rojods committed Nov 2, 2023
1 parent 9f60940 commit 65a5946
Show file tree
Hide file tree
Showing 4 changed files with 1,846 additions and 569 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -228,12 +228,11 @@ default Stream<ExplorationSolution> exploreAADPMMM(
jobIdxGraph.addEdge(src, dst);
});
var engine = Engine
.builder(g -> evaluateAADPMMM(g, jobs, jobIdxGraph, configuration), codec)
.builder(g -> evaluateAADPMMM(g, jobs, jobIdxGraph, configuration), allConstraints.constrain(codec))
.populationSize(decisionModel.partitionedMemMappableMulticore().runtimes().runtimes()
.size() * decisionModel.aperiodicAsynchronousDataflows().size() * 5)
.offspringSelector(new TournamentSelector<>(5))
.survivorsSelector(UFTournamentSelector.ofVec())
// .alterers(new Mutator<>(0.05))
.constraint(allConstraints)
.alterers(
new UniformCrossover<>(0.2, 0.25),
Expand Down Expand Up @@ -261,7 +260,6 @@ default Stream<ExplorationSolution> exploreAADPMMM(
// ? decodedStream.limit(configuration.maximumSolutions)
// : decodedStream;
return limitedImprovementStream
.filter(sol -> allConstraints.test(sol.bestPhenotype()))
.map(sol -> {
var decoded = codec.decode(sol.bestPhenotype().genotype());
var solMap = new HashMap<String, Double>(sol.bestFitness().length());
Expand Down
Loading

0 comments on commit 65a5946

Please sign in to comment.