Package org.opt4j.core.domination
Class ConstraintCheckerImpl
java.lang.Object
org.opt4j.core.domination.ConstraintCheckerImpl
- All Implemented Interfaces:
ConstraintChecker,IndividualSetListener,IndividualStateListener
public class ConstraintCheckerImpl
extends Object
implements ConstraintChecker, IndividualSetListener, IndividualStateListener
ConstraintCheckerImpl calculates constraint violations of
infeasibility constraints.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<Constraint,Range> stores the current range of criterion values in the population for each constraint i.e. -
Constructor Summary
ConstructorsConstructorDescriptionConstraintCheckerImpl(Population population) as this class listens on Population, it must be registered there -
Method Summary
Modifier and TypeMethodDescriptiondoubleCalculates the constraint violation ofObjectives.voidindividualAdded(IndividualSet collection, Individual individual) Invoked if theIndividualis added to theIndividualSet.voidindividualRemoved(IndividualSet collection, Individual individual) Invoked if theIndividualis removed from theIndividualSet.voidinidividualStateChanged(Individual individual) Invoked if theIndividualchanges its state.protected booleanisEligibleConstraint(Constraint constraint) booleanChecks, ifObjectivesis feasible.protected booleanisIneligibleConstraint(Constraint constraint)
-
Field Details
-
constraintRanges
stores the current range of criterion values in the population for each constraint i.e. stores the minimum value in the population for each Constraint and the maimum value. make it thread safe to avoid accidental problems.
-
-
Constructor Details
-
ConstraintCheckerImpl
as this class listens on Population, it must be registered there
-
-
Method Details
-
isEligibleConstraint
-
isIneligibleConstraint
-
getConstraintViolation
Calculates the constraint violation ofObjectives.- Specified by:
getConstraintViolationin interfaceConstraintChecker- Parameters:
o- the objectives to check- Returns:
- the amount of constraint violation
-
isFeasible
Checks, ifObjectivesis feasible.- Specified by:
isFeasiblein interfaceConstraintChecker- Parameters:
o- the objectives to check- Returns:
- the feasibility
-
individualAdded
Description copied from interface:IndividualSetListenerInvoked if theIndividualis added to theIndividualSet.- Specified by:
individualAddedin interfaceIndividualSetListener- Parameters:
collection- the observed collectionindividual- the added individual
-
individualRemoved
Description copied from interface:IndividualSetListenerInvoked if theIndividualis removed from theIndividualSet.- Specified by:
individualRemovedin interfaceIndividualSetListener- Parameters:
collection- the observed collectionindividual- the removed individual
-
inidividualStateChanged
Description copied from interface:IndividualStateListenerInvoked if theIndividualchanges its state.- Specified by:
inidividualStateChangedin interfaceIndividualStateListener- Parameters:
individual- the individual that changes the state
-