Skip to content

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

Closed
@ln53491

Description

@ln53491

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))

Metadata

Metadata

Assignees

No one assigned

    Labels

    resolution/duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions