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

Common Codec.map functions #805

Open
jenetics opened this issue Oct 20, 2021 · 0 comments
Open

Common Codec.map functions #805

jenetics opened this issue Oct 20, 2021 · 0 comments
Assignees

Comments

@jenetics
Copy link
Owner

Jenetics requires the Chromosomes in a Genotype to have the same Gene type. Sometimes it is necessary to have chromosome with different gene types, which is not possible. One solution for this problem is to use one Gene type, e.g. DoubleGene and do the mapping in the Codec.

final Codec<int[|, DoubleGene> codec = Codecs.ofVector(DoubleRange.of(0, 1), 10)
    .map(v -> DoubleStream.of(v).mapToInt(d -> (int)d).toArray());

This ticket is about to add some commonly useable mapping functions.

jenetics added a commit that referenced this issue Oct 21, 2021
jenetics added a commit that referenced this issue Oct 21, 2021
jenetics added a commit that referenced this issue Oct 31, 2021
jenetics added a commit that referenced this issue Oct 31, 2021
jenetics added a commit that referenced this issue Oct 31, 2021
@jenetics jenetics self-assigned this Nov 9, 2021
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

1 participant