OptaPlanner distribution 6.2.1-SNAPSHOT

org.optaplanner.core.impl.domain.variable.listener
Interface VariableListener<EntityG>

All Superinterfaces:
Supply
All Known Subinterfaces:
StatefulVariableListener<EntityG>
All Known Implementing Classes:
AnchorVariableListener, ArrivalTimeUpdatingVariableListener, ExternalizedAnchorVariableSupply, ExternalizedSingletonInverseVariableSupply, PeriodUpdatingVariableListener, PredecessorsDoneDateUpdatingVariableListener, SingletonInverseVariableListener

public interface VariableListener<EntityG>
extends Supply

Changes shadow variables when a genuine planning variable changes.

Important: it must only change the shadow variable for which it's configured! It should never change a genuine variable or a problem fact. It can change its shadow variable on multiple entity instances (for example: an arrivalTime change affects all trailing entities too)

Each ScoreDirector has a different VariableListener instance, so it can be stateful. If it is stateful, it should implement StatefulVariableListener.


Method Summary
 void afterEntityAdded(ScoreDirector scoreDirector, EntityG entity)
           
 void afterEntityRemoved(ScoreDirector scoreDirector, EntityG entity)
           
 void afterVariableChanged(ScoreDirector scoreDirector, EntityG entity)
           
 void beforeEntityAdded(ScoreDirector scoreDirector, EntityG entity)
           
 void beforeEntityRemoved(ScoreDirector scoreDirector, EntityG entity)
           
 void beforeVariableChanged(ScoreDirector scoreDirector, EntityG entity)
           
 

Method Detail

beforeEntityAdded

void beforeEntityAdded(ScoreDirector scoreDirector,
                       EntityG entity)

afterEntityAdded

void afterEntityAdded(ScoreDirector scoreDirector,
                      EntityG entity)

beforeVariableChanged

void beforeVariableChanged(ScoreDirector scoreDirector,
                           EntityG entity)

afterVariableChanged

void afterVariableChanged(ScoreDirector scoreDirector,
                          EntityG entity)

beforeEntityRemoved

void beforeEntityRemoved(ScoreDirector scoreDirector,
                         EntityG entity)

afterEntityRemoved

void afterEntityRemoved(ScoreDirector scoreDirector,
                        EntityG entity)

OptaPlanner distribution 6.2.1-SNAPSHOT

Copyright © 2006-2015 JBoss by Red Hat. All Rights Reserved.