Skip to content

Shadow variable updaters need to be able to read the solution #1961

@triceo

Description

@triceo

The current approach to custom variables lets users define a method that will update the value of the variable based on other variables in the entity. However, it doesn't allow access to information on the solution.

This access is useful, so that static data don't need to be propagated to every entity, making cloning more expensive and overall code more complicated.

The proposed approach is to introduce an optional solution argument to the variable updater which the solver would fill, if the user declares the updater as such.

Therefore instead of:

 public Employee updateEmployee() {
     ....
 }

The user could optionally decide to declare the updater as such:

 public Employee updateEmployee(EmployeeSchedule schedule) {
     ....
 }

The intention is not to use any of the solution's fields as sources. The user must not modify the data on the solution and if they do, they are on their own with the score corruptions that will ensue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions