Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow async fitness functions #364

Closed
jenetics opened this issue Jun 13, 2018 · 2 comments
Closed

Allow async fitness functions #364

jenetics opened this issue Jun 13, 2018 · 2 comments
Assignees
Milestone

Comments

@jenetics
Copy link
Owner

The fitness function currently must be evaluated synchronous. It should be possible to define fitness functions which return a Future object.

public Future<Double> fitness(final Genotype<DoubleGene> gt) {
    return ...;
}

Genotype<DoubleGene> gtf = Genotype.of(DoubleChromosome.of(0, 1));
Engine<DoubleGene, Double> engine = Engine.build(this::fitness, gtf).build();
@jenetics jenetics self-assigned this Jun 13, 2018
@gfrison
Copy link

gfrison commented Jun 14, 2018

Hello,

Instead of Future could be possible to return a CompletableFuture? The latter is more suitable for callbacks.

Thank you,

@jenetics jenetics added this to the v5.0.0 milestone Jun 15, 2018
jenetics added a commit that referenced this issue Jun 23, 2018
jenetics added a commit that referenced this issue Jun 23, 2018
jenetics added a commit that referenced this issue Jun 24, 2018
jenetics added a commit that referenced this issue Jun 24, 2018
jenetics added a commit that referenced this issue Jun 24, 2018
jenetics added a commit that referenced this issue Jun 24, 2018
jenetics added a commit that referenced this issue Jun 24, 2018
jenetics added a commit that referenced this issue Jun 24, 2018
jenetics added a commit that referenced this issue Jun 24, 2018
jenetics added a commit that referenced this issue Jan 26, 2019
jenetics added a commit that referenced this issue Jan 26, 2019
jenetics added a commit that referenced this issue Jan 26, 2019
jenetics added a commit that referenced this issue Jan 26, 2019
jenetics added a commit that referenced this issue Jan 26, 2019
@jenetics
Copy link
Owner Author

Merged into r5.0.0 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants