Skip to content

Type safe delta evaluations and validations #28

@hdbeukel

Description

@hdbeukel

Add abstract (inner) classes

  • Objective.WithDelta
  • Constraint.WithDelta
  • PenalizingConstraint.WithDelta

that allow to dynamically attach type safe delta evaluations/validations for one or more move types, through a method call like useDelta(MyMove.class, (move, sol, eval/val, data) -> ...). These calls can for example be grouped in the constructor of the objective/constraint, and may use method references to specify the delta evaluation/validation function, as in useDelta(MyMove.class, this::evaluateMyMove).

To evaluate/validate a move, the list of attached delta evaluations/validations is scanned to find one that matches the move type (any super type of the received move). In case of multiple matches, the first one is used. If there is no match, the objective/constraint falls back to full evaluation/validation for that move.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions