Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SimulatedAnnealing"/> class.
        /// </summary>
        /// <param name="direction">The direction.</param>
        /// <param name="ConstraintsSolvedWithPenalties">The constraints solved with penalties.</param>
        public SimulatedAnnealing(optimize direction, Boolean ConstraintsSolvedWithPenalties = true)
        {
            RequiresObjectiveFunction           = true;
            this.ConstraintsSolvedWithPenalties = ConstraintsSolvedWithPenalties;
            InequalitiesConvertedToEqualities   = false;
            RequiresSearchDirectionMethod       = false;
            RequiresLineSearchMethod            = false;
            RequiresAnInitialPoint          = true;
            RequiresConvergenceCriteria     = true;
            RequiresFeasibleStartPoint      = false;
            RequiresDiscreteSpaceDescriptor = true;

            selector = new MetropolisCriteria(direction);
        }
Ejemplo n.º 2
0
 public override void Add(object function)
 {
     if (function is abstractGenerator)
     {
         neighborGenerator = (abstractGenerator)function;
     }
     else if (function is abstractSelector)
     {
         selector = (abstractSelector)function;
     }
     else
     {
         base.Add(function);
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Adds the specified object to the optimization routine.
 /// </summary>
 /// <param name="function">The object, function.</param>
 public override void Add(object function)
 {
     if (function is SamplingGenerator)
     {
         initGenerator = (SamplingGenerator)function;
     }
     else if (function is GeneticCrossoverGenerator)
     {
         crossoverGenerator = (GeneticCrossoverGenerator)function;
     }
     else if (function is GeneticMutationGenerator)
     {
         mutationGenerator = (GeneticMutationGenerator)function;
     }
     else if (function is abstractSelector)
     {
         fitnessSelector = (abstractSelector)function;
     }
     else
     {
         base.Add(function);
     }
 }