Exemplo n.º 1
0
 private TabuSearch(TabuSearch original, Cloner cloner)
     : base(original, cloner)
 {
     moveQualityAnalyzer      = cloner.Clone(original.moveQualityAnalyzer);
     tabuNeighborhoodAnalyzer = cloner.Clone(original.tabuNeighborhoodAnalyzer);
     Initialize();
 }
Exemplo n.º 2
0
        public TabuSearch()
            : base()
        {
            Parameters.Add(new ValueParameter <IntValue>("Seed", "The random seed used to initialize the new pseudo random number generator.", new IntValue(0)));
            Parameters.Add(new ValueParameter <BoolValue>("SetSeedRandomly", "True if the random seed should be set to a random value, otherwise false.", new BoolValue(true)));
            Parameters.Add(new ConstrainedValueParameter <IMoveGenerator>("MoveGenerator", "The operator used to generate moves to the neighborhood of the current solution."));
            Parameters.Add(new ConstrainedValueParameter <IMoveMaker>("MoveMaker", "The operator used to perform a move."));
            Parameters.Add(new ConstrainedValueParameter <ISingleObjectiveMoveEvaluator>("MoveEvaluator", "The operator used to evaluate a move."));
            Parameters.Add(new ConstrainedValueParameter <ITabuChecker>("TabuChecker", "The operator to check whether a move is tabu or not."));
            Parameters.Add(new ConstrainedValueParameter <ITabuMaker>("TabuMaker", "The operator used to insert attributes of a move into the tabu list."));
            Parameters.Add(new ValueParameter <IntValue>("TabuTenure", "The length of the tabu list.", new IntValue(10)));
            Parameters.Add(new ValueParameter <IntValue>("MaximumIterations", "The maximum number of generations which should be processed.", new IntValue(1000)));
            Parameters.Add(new ValueParameter <IntValue>("SampleSize", "The neighborhood size for stochastic sampling move generators", new IntValue(100)));
            Parameters.Add(new ValueParameter <MultiAnalyzer>("Analyzer", "The operator used to analyze the solution.", new MultiAnalyzer()));

            RandomCreator      randomCreator    = new RandomCreator();
            SolutionsCreator   solutionsCreator = new SolutionsCreator();
            VariableCreator    variableCreator  = new VariableCreator();
            ResultsCollector   resultsCollector = new ResultsCollector();
            TabuSearchMainLoop mainLoop         = new TabuSearchMainLoop();

            OperatorGraph.InitialOperator = randomCreator;

            randomCreator.RandomParameter.ActualName          = "Random";
            randomCreator.SeedParameter.ActualName            = SeedParameter.Name;
            randomCreator.SeedParameter.Value                 = null;
            randomCreator.SetSeedRandomlyParameter.ActualName = SetSeedRandomlyParameter.Name;
            randomCreator.SetSeedRandomlyParameter.Value      = null;
            randomCreator.Successor = solutionsCreator;

            solutionsCreator.NumberOfSolutions = new IntValue(1);
            solutionsCreator.Successor         = variableCreator;

            variableCreator.Name = "Initialize EvaluatedMoves";
            variableCreator.CollectedValues.Add(new ValueParameter <IntValue>("EvaluatedMoves", new IntValue()));
            variableCreator.Successor = resultsCollector;

            resultsCollector.CollectedValues.Add(new LookupParameter <IntValue>("Evaluated Moves", null, "EvaluatedMoves"));
            resultsCollector.ResultsParameter.ActualName = "Results";
            resultsCollector.Successor = mainLoop;

            mainLoop.MoveGeneratorParameter.ActualName     = MoveGeneratorParameter.Name;
            mainLoop.MoveMakerParameter.ActualName         = MoveMakerParameter.Name;
            mainLoop.MoveEvaluatorParameter.ActualName     = MoveEvaluatorParameter.Name;
            mainLoop.TabuCheckerParameter.ActualName       = TabuCheckerParameter.Name;
            mainLoop.TabuMakerParameter.ActualName         = TabuMakerParameter.Name;
            mainLoop.MaximumIterationsParameter.ActualName = MaximumIterationsParameter.Name;
            mainLoop.RandomParameter.ActualName            = RandomCreator.RandomParameter.ActualName;
            mainLoop.ResultsParameter.ActualName           = "Results";
            mainLoop.AnalyzerParameter.ActualName          = AnalyzerParameter.Name;
            mainLoop.EvaluatedMovesParameter.ActualName    = "EvaluatedMoves";

            moveQualityAnalyzer      = new BestAverageWorstQualityAnalyzer();
            tabuNeighborhoodAnalyzer = new TabuNeighborhoodAnalyzer();
            ParameterizeAnalyzers();
            UpdateAnalyzers();

            Initialize();
        }
Exemplo n.º 3
0
 private TabuSearch(TabuSearch original, Cloner cloner)
   : base(original, cloner) {
   moveQualityAnalyzer = cloner.Clone(original.moveQualityAnalyzer);
   tabuNeighborhoodAnalyzer = cloner.Clone(original.tabuNeighborhoodAnalyzer);
   Initialize();
 }
Exemplo n.º 4
0
    public TabuSearch()
      : base() {
      Parameters.Add(new ValueParameter<IntValue>("Seed", "The random seed used to initialize the new pseudo random number generator.", new IntValue(0)));
      Parameters.Add(new ValueParameter<BoolValue>("SetSeedRandomly", "True if the random seed should be set to a random value, otherwise false.", new BoolValue(true)));
      Parameters.Add(new ConstrainedValueParameter<IMoveGenerator>("MoveGenerator", "The operator used to generate moves to the neighborhood of the current solution."));
      Parameters.Add(new ConstrainedValueParameter<IMoveMaker>("MoveMaker", "The operator used to perform a move."));
      Parameters.Add(new ConstrainedValueParameter<ISingleObjectiveMoveEvaluator>("MoveEvaluator", "The operator used to evaluate a move."));
      Parameters.Add(new ConstrainedValueParameter<ITabuChecker>("TabuChecker", "The operator to check whether a move is tabu or not."));
      Parameters.Add(new ConstrainedValueParameter<ITabuMaker>("TabuMaker", "The operator used to insert attributes of a move into the tabu list."));
      Parameters.Add(new ValueParameter<IntValue>("TabuTenure", "The length of the tabu list.", new IntValue(10)));
      Parameters.Add(new ValueParameter<IntValue>("MaximumIterations", "The maximum number of generations which should be processed.", new IntValue(1000)));
      Parameters.Add(new ValueParameter<IntValue>("SampleSize", "The neighborhood size for stochastic sampling move generators", new IntValue(100)));
      Parameters.Add(new ValueParameter<MultiAnalyzer>("Analyzer", "The operator used to analyze the solution.", new MultiAnalyzer()));

      RandomCreator randomCreator = new RandomCreator();
      SolutionsCreator solutionsCreator = new SolutionsCreator();
      VariableCreator variableCreator = new VariableCreator();
      ResultsCollector resultsCollector = new ResultsCollector();
      TabuSearchMainLoop mainLoop = new TabuSearchMainLoop();
      OperatorGraph.InitialOperator = randomCreator;

      randomCreator.RandomParameter.ActualName = "Random";
      randomCreator.SeedParameter.ActualName = SeedParameter.Name;
      randomCreator.SeedParameter.Value = null;
      randomCreator.SetSeedRandomlyParameter.ActualName = SetSeedRandomlyParameter.Name;
      randomCreator.SetSeedRandomlyParameter.Value = null;
      randomCreator.Successor = solutionsCreator;

      solutionsCreator.NumberOfSolutions = new IntValue(1);
      solutionsCreator.Successor = variableCreator;

      variableCreator.Name = "Initialize EvaluatedMoves";
      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedMoves", new IntValue()));
      variableCreator.Successor = resultsCollector;

      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Moves", null, "EvaluatedMoves"));
      resultsCollector.ResultsParameter.ActualName = "Results";
      resultsCollector.Successor = mainLoop;

      mainLoop.MoveGeneratorParameter.ActualName = MoveGeneratorParameter.Name;
      mainLoop.MoveMakerParameter.ActualName = MoveMakerParameter.Name;
      mainLoop.MoveEvaluatorParameter.ActualName = MoveEvaluatorParameter.Name;
      mainLoop.TabuCheckerParameter.ActualName = TabuCheckerParameter.Name;
      mainLoop.TabuMakerParameter.ActualName = TabuMakerParameter.Name;
      mainLoop.MaximumIterationsParameter.ActualName = MaximumIterationsParameter.Name;
      mainLoop.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName;
      mainLoop.ResultsParameter.ActualName = "Results";
      mainLoop.AnalyzerParameter.ActualName = AnalyzerParameter.Name;
      mainLoop.EvaluatedMovesParameter.ActualName = "EvaluatedMoves";

      moveQualityAnalyzer = new BestAverageWorstQualityAnalyzer();
      tabuNeighborhoodAnalyzer = new TabuNeighborhoodAnalyzer();
      ParameterizeAnalyzers();
      UpdateAnalyzers();

      Initialize();
    }
 protected TabuNeighborhoodAnalyzer(TabuNeighborhoodAnalyzer original, Cloner cloner)
   : base(original, cloner) {
 }
Exemplo n.º 6
0
 protected TabuNeighborhoodAnalyzer(TabuNeighborhoodAnalyzer original, Cloner cloner)
     : base(original, cloner)
 {
 }