Uploaded image for project: 'OptaPlanner'
  1. OptaPlanner
  2. PLANNER-1849

Constraint Streams: support multiple groupBy calls

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major Major
    • 7.34.0.Final
    • 7.33.0.Final
    • optaplanner-core
    • None

      In some constraints, multiple groupBy calls might be necessary. See Machine reassignment : service move cost as an example:

      return factory.from(MrProcessAssignment.class)
      .filter(MrProcessAssignment::isMoved)
      .groupBy(processAssignment -> processAssignment.getService(), ConstraintCollectors.countLong())
      .groupBy((service, processMoveCount) -> processMoveCount)
      .groupBy(ConstraintCollectors.max())
      ...

              lpetrovi@redhat.com Lukáš Petrovický (Inactive)
              rsynek@redhat.com Radovan Synek (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: