public ProbabilityValueSelector( ValueSelector childValueSelector, SelectionCacheType cacheType, SelectionProbabilityWeightFactory valueProbabilityWeightFactory) { this.childValueSelector = childValueSelector; this.cacheType = cacheType; this.valueProbabilityWeightFactory = valueProbabilityWeightFactory; if (childValueSelector.isNeverEnding()) { throw new IllegalStateException( "The selector (" + this + ") has a childValueSelector (" + childValueSelector + ") with neverEnding (" + childValueSelector.isNeverEnding() + ")."); } solverPhaseLifecycleSupport.addEventListener(childValueSelector); if (cacheType.isNotCached()) { throw new IllegalArgumentException( "The selector (" + this + ") does not support the cacheType (" + cacheType + ")."); } solverPhaseLifecycleSupport.addEventListener( new SelectionCacheLifecycleBridge(cacheType, this)); }
public FromSolutionPropertyValueSelector( PlanningVariableDescriptor variableDescriptor, SelectionCacheType cacheType, boolean randomSelection) { this.variableDescriptor = variableDescriptor; this.cacheType = cacheType; this.randomSelection = randomSelection; if (cacheType.isNotCached()) { throw new IllegalArgumentException( "The selector (" + this + ") does not support the cacheType (" + cacheType + ")."); } solverPhaseLifecycleSupport.addEventListener( new SelectionCacheLifecycleBridge(cacheType, this)); }
public AbstractCachingMoveSelector(MoveSelector childMoveSelector, SelectionCacheType cacheType) { this.childMoveSelector = childMoveSelector; this.cacheType = cacheType; if (childMoveSelector.isNeverEnding()) { throw new IllegalStateException( "The selector (" + this + ") has a childMoveSelector (" + childMoveSelector + ") with neverEnding (" + childMoveSelector.isNeverEnding() + ")."); } solverPhaseLifecycleSupport.addEventListener(childMoveSelector); if (cacheType.isNotCached()) { throw new IllegalArgumentException( "The selector (" + this + ") does not support the cacheType (" + cacheType + ")."); } solverPhaseLifecycleSupport.addEventListener( new SelectionCacheLifecycleBridge(cacheType, this)); }