Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010 JBoss Inc
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 package org.drools.planner.config.localsearch;
 
 
 @XStreamAlias("localSearch")
 
     // Warning: all fields are null (and not defaulted) because they can be inherited
     // and also because the input config file should match the output config file
 
     @XStreamAlias("deciderScoreComparatorFactory")
             = new DeciderScoreComparatorFactoryConfig();
     @XStreamAlias("selector")
     private SelectorConfig selectorConfig = new SelectorConfig();
     @XStreamAlias("acceptor")
     private AcceptorConfig acceptorConfig = new AcceptorConfig();
     @XStreamAlias("forager")
     private ForagerConfig foragerConfig = new ForagerConfig();
 
         return ;
     }
 
             DeciderScoreComparatorFactoryConfig deciderScoreComparatorFactoryConfig) {
         this. = deciderScoreComparatorFactoryConfig;
     }
 
     public SelectorConfig getSelectorConfig() {
         return ;
     }
 
     public void setSelectorConfig(SelectorConfig selectorConfig) {
         this. = selectorConfig;
     }
 
     public AcceptorConfig getAcceptorConfig() {
         return ;
     }
 
     public void setAcceptorConfig(AcceptorConfig acceptorConfig) {
         this. = acceptorConfig;
     }
 
     public ForagerConfig getForagerConfig() {
         return ;
     }
 
     public void setForagerConfig(ForagerConfig foragerConfig) {
         this. = foragerConfig;
     }
 
     // ************************************************************************
     // Builder methods
     // ************************************************************************
 
     public LocalSearchSolverPhase buildSolverPhase(EnvironmentMode environmentMode,
             SolutionDescriptor solutionDescriptorScoreDefinition scoreDefinitionTermination solverTermination) {
         DefaultLocalSearchSolverPhase localSearchSolverPhase = new DefaultLocalSearchSolverPhase();
         configureSolverPhase(localSearchSolverPhaseenvironmentModescoreDefinitionsolverTermination);
         localSearchSolverPhase.setDecider(buildDecider(environmentModescoreDefinition));
         if (environmentMode == . || environmentMode == .) {
             localSearchSolverPhase.setAssertStepScoreIsUncorrupted(true);
         }
         return localSearchSolverPhase;
     }
 
     private Decider buildDecider(EnvironmentMode environmentModeScoreDefinition scoreDefinition) {
         DefaultDecider decider = new DefaultDecider();
        decider.setSelector(.buildSelector(scoreDefinition));
        decider.setAcceptor(.buildAcceptor(environmentModescoreDefinition));
        decider.setForager(.buildForager(scoreDefinition));
        if (environmentMode == .) {
            decider.setAssertMoveScoreIsUncorrupted(true);
        }
        if (environmentMode == . || environmentMode == .) {
            decider.setAssertUndoMoveIsUncorrupted(true);
        }
        return decider;
    }
    public void inherit(LocalSearchSolverPhaseConfig inheritedConfig) {
        super.inherit(inheritedConfig);
        if ( == null) {
        } else if (inheritedConfig.getDeciderScoreComparatorFactoryConfig() != null) {
        }
        if ( == null) {
             = inheritedConfig.getSelectorConfig();
        } else if (inheritedConfig.getSelectorConfig() != null) {
            .inherit(inheritedConfig.getSelectorConfig());
        }
        if ( == null) {
             = inheritedConfig.getAcceptorConfig();
        } else if (inheritedConfig.getAcceptorConfig() != null) {
            .inherit(inheritedConfig.getAcceptorConfig());
        }
        if ( == null) {
             = inheritedConfig.getForagerConfig();
        } else if (inheritedConfig.getForagerConfig() != null) {
            .inherit(inheritedConfig.getForagerConfig());
        }
    }
New to GrepCode? Check out our FAQ X