/// <summary>Initializes a new instance of the <see cref="LevenbergMarquardtOptimizer"/> class.
        /// </summary>
        /// <param name="abortCondition">The abort (stopping) condition for the Simulated Annealing optimizer.</param>
        public LevenbergMarquardtOptimizer(LevenbergMarquardtAbortCondition abortCondition)
        {
            AbortCondition = abortCondition ?? throw new ArgumentNullException(nameof(abortCondition));

            m_Name = new IdentifierString("Levenberg-Marquardt");
            m_FunctionDescriptor   = new MultivariateFunctionFactory();
            m_ConstraintDescriptor = new MultiDimOptimizerConstraintFactory(MultiDimOptimizerConstraintFactory.ConstraintType.Box | MultiDimOptimizerConstraintFactory.ConstraintType.LinearEquation | MultiDimOptimizerConstraintFactory.ConstraintType.LinearInEquation | MultiDimOptimizerConstraintFactory.ConstraintType.None);
        }
Exemplo n.º 2
0
        /// <summary>Initializes a new instance of the <see cref="GoldfarbIdanaQuadraticProgram"/> class.
        /// </summary>
        /// <param name="abortCondition">The abort (stopping) condition for the Simulated Annealing optimizer.</param>
        public GoldfarbIdanaQuadraticProgram(GoldfarbIdanaQuadraticProgramAbortCondition abortCondition)
        {
            AbortCondition = abortCondition ?? throw new ArgumentNullException(nameof(abortCondition));

            m_Name = new IdentifierString("Quadratic programming optimizer");
            m_FunctionDescriptor   = new QuadraticProgramFunctionFactory();
            m_ConstraintDescriptor = new MultiDimOptimizerConstraintFactory(MultiDimOptimizerConstraintFactory.ConstraintType.Box | MultiDimOptimizerConstraintFactory.ConstraintType.LinearEquation | MultiDimOptimizerConstraintFactory.ConstraintType.LinearInEquation | MultiDimOptimizerConstraintFactory.ConstraintType.None);
        }
Exemplo n.º 3
0
        /// <summary>Initializes a new instance of the <see cref="PowellOptimizer"/> class.
        /// </summary>
        /// <param name="abortCondition">The abort (stopping) condition for the Simulated Annealing optimizer.</param>
        /// <param name="lineSearchOptimizer">The line search optimizer to take into account.</param>
        /// <param name="constraintProvider">The constraint provider, i.e. transformation etc. for the support of specific constraints (the original algorithm does not support any constraints).</param>
        public PowellOptimizer(PowellOptimizerAbortCondition abortCondition, OneDimOptimizer lineSearchOptimizer, MultiDimOptimizerConstraintProvider constraintProvider)
        {
            AbortCondition       = abortCondition ?? throw new ArgumentNullException(nameof(abortCondition));
            LineSearchOptimizer  = lineSearchOptimizer ?? throw new ArgumentNullException(nameof(lineSearchOptimizer));
            m_ConstraintProvider = constraintProvider ?? throw new ArgumentNullException(nameof(constraintProvider));

            m_Name = new IdentifierString("Powell optimizer");
            m_FunctionDescriptor   = new OrdinaryMultiDimOptimizerFunctionFactory();
            m_ConstraintDescriptor = new MultiDimOptimizerConstraintFactory(constraintProvider.SupportedConstraints);
        }
Exemplo n.º 4
0
        /// <summary>Initializes a new instance of the <see cref="NelderMeadOptimizer"/> class.
        /// </summary>
        /// <param name="abortCondition">The abort (stopping) condition for the Nelder-Mead optimizer.</param>
        /// <param name="constraintProvider">The constraint provider, i.e. transformation etc. for the support of specific constraints (the original algorithm does not support any constraints).</param>
        /// <param name="initialScaleFactor">A scaling factor which is used to create from a specific initial guess the N + 1 points (in \R^N) of the start simplex.</param>
        public NelderMeadOptimizer(NelderMeadOptimizerAbortCondition abortCondition, MultiDimOptimizerConstraintProvider constraintProvider, double initialScaleFactor = 1.0)
        {
            AbortCondition       = abortCondition ?? throw new ArgumentNullException(nameof(abortCondition));
            m_ConstraintProvider = constraintProvider ?? throw new ArgumentNullException(nameof(constraintProvider));

            m_Name = new IdentifierString("Nelder-Mead-Simplex search optimizer");
            m_FunctionDescriptor   = new OrdinaryMultiDimOptimizerFunctionFactory();
            m_ConstraintDescriptor = new MultiDimOptimizerConstraintFactory(constraintProvider.SupportedConstraints);
            InitialScaleFactor     = initialScaleFactor;
        }
Exemplo n.º 5
0
        /// <summary>Initializes a new instance of the <see cref="PraxisOptimizer"/> class.
        /// </summary>
        /// <param name="randomNumberStream">The random number stream.</param>
        /// <param name="abortCondition">The abort (stopping) condition for the Simulated Annealing optimizer.</param>
        /// <param name="constraintProvider">The constraint provider, i.e. transformation etc. for the support of specific constraints (the original algorithm does not support any constraints).</param>
        /// <param name="scalingFactor">A scaling parameter. If the scales for the different parameters are very different this value should be/ set to a value of about 10.0.</param>
        /// <param name="expectedDistanceToSolution">A step length parameter which should be set equal to the expected distance from the solution.</param>
        public PraxisOptimizer(IRandomNumberStream randomNumberStream, PraxisOptimizerAbortCondition abortCondition, MultiDimOptimizerConstraintProvider constraintProvider, double scalingFactor = 1.0, double expectedDistanceToSolution = 1.0)
        {
            if (randomNumberStream == null)
            {
                throw new ArgumentNullException(nameof(randomNumberStream));
            }
            m_SingleRandomNumberStream = new SingleRandomNumberStream(randomNumberStream, 250);
            AbortCondition             = abortCondition ?? throw new ArgumentNullException(nameof(abortCondition));
            m_ConstraintProvider       = constraintProvider ?? throw new ArgumentNullException(nameof(constraintProvider));

            ScalingFactor = scalingFactor;
            ExpectedDistanceToSolution = expectedDistanceToSolution;
            m_Name = new IdentifierString("PRAXIS optimizer");
            m_FunctionDescriptor   = new OrdinaryMultiDimOptimizerFunctionFactory();
            m_ConstraintDescriptor = new MultiDimOptimizerConstraintFactory(constraintProvider.SupportedConstraints);
        }
Exemplo n.º 6
0
 /// <summary>Initializes a new instance of the <see cref="MultiDimOptimizerConstraint" /> class.
 /// </summary>
 /// <param name="constraintDescriptor">The constraint descriptor.</param>
 /// <param name="constraint">The constraint of the optimizer in its <see cref="IMultiDimRegion"/> representation.</param>
 public MultiDimOptimizerConstraint(MultiDimOptimizerConstraintFactory constraintDescriptor, IMultiDimRegion constraint)
 {
     Factory = constraintDescriptor ?? throw new ArgumentNullException(nameof(constraintDescriptor));
     RegionRepresentation = constraint ?? throw new ArgumentNullException(nameof(constraint));
 }