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

Feat: Setting Hard Score and Soft Score to different values in the Constraint Stream #1348

Closed
ln53491 opened this issue Jan 23, 2025 · 1 comment
Labels
resolution/duplicate This issue or pull request already exists

Comments

@ln53491
Copy link

ln53491 commented Jan 23, 2025

Main goal is to avoid having two separate constraint streams which compute the same value used for both scores.

The desired result for one of the use cases:

.forEach(Entity.class)
.groupBy(Function.identity(), sum(Entity::getValue))
.map((entity, value) -> value)
.penalize(HardSoftScore.of(value > 100 ? value : 0, value))

Or perhaps using lambda function directly in the penalize/reward like this:

.forEach(Entity.class)
.groupBy(Function.identity(), sum(Entity::getValue))
.penalize((entity, value) -> HardSoftScore.of(value > 100 ? value : 0, value))
@ln53491 ln53491 added enhancement New feature or request process/needs triage Requires initial assessment of validity, priority etc. labels Jan 23, 2025
@ln53491 ln53491 changed the title Feat: Setting Hard Score and Soft Score to different values based in the Constraint Stream Feat: Setting Hard Score and Soft Score to different values in the Constraint Stream Jan 23, 2025
@triceo
Copy link
Contributor

triceo commented Jan 23, 2025

Hello @ln53491, and thanks for taking the time to report this!

Please see a previously reported feature request #1172, where I believe we've already discussed this.
I am going to close this one as a duplicate.

@triceo triceo closed this as completed Jan 23, 2025
@triceo triceo added resolution/duplicate This issue or pull request already exists and removed enhancement New feature or request process/needs triage Requires initial assessment of validity, priority etc. labels Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolution/duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants