Interface ListVariableStateSupply<Solution_>

Type Parameters:
Solution_ -
All Superinterfaces:
AbstractVariableListener<Solution_,Object>, AutoCloseable, Closeable, IndexVariableSupply, ListVariableListener<Solution_,Object,Object>, SingletonInverseVariableSupply, SourcedVariableListener<Solution_>, Supply

public interface ListVariableStateSupply<Solution_> extends SourcedVariableListener<Solution_>, ListVariableListener<Solution_,Object,Object>, SingletonInverseVariableSupply, IndexVariableSupply
Single source of truth for all information about elements inside list variables. Shadow variables can be connected to this class to save on iteration costs that would've been incurred otherwise if using variable listeners for each of them independently. This way, there is only one variable listener for all such shadow variables, and therefore only a single iteration to update all the information.

If a particular shadow variable is externalized, it means that there is a field on an entity holding the value of the shadow variable. In this case, we will attempt to use that value. Otherwise, we will keep an internal track of all the possible shadow variables (IndexShadowVariable, InverseRelationShadowVariable, PreviousElementShadowVariable, NextElementShadowVariable), and use values from this internal representation.

See Also:
  • The logic of switching between internal and externalized shadow variables.
  • The external representation of these shadow variables, which doesn't care whether the variable is internal or externalized.