本文整理汇总了Python中pyOpt.Optimizer类的典型用法代码示例。如果您正苦于以下问题:Python Optimizer类的具体用法?Python Optimizer怎么用?Python Optimizer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Optimizer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, pll_type=None, *args, **kwargs):
"""
ALHSO Optimizer Class Initialization
**Keyword arguments:**
- pll_type -> STR: Parallel Implementation (None, 'POA'-Parallel Objective Analysis), *Default* = None
Documentation last updated: Feb. 16, 2010 - Peter W. Jansen
"""
#
if pll_type == None:
self.poa = False
elif pll_type.upper() == "POA":
self.poa = True
else:
raise ValueError("pll_type must be either None or 'POA'")
# end
#
name = "ALHSO"
category = "Global Optimizer"
def_opts = {
"hms": [int, 5], # Memory Size [1,50]
"hmcr": [float, 0.95], # Probability rate of choosing from memory [0.7,0.99]
"par": [float, 0.65], # Pitch adjustment rate [0.1,0.99]
"dbw": [int, 2000], # Variable Bandwidth Quantization
"maxoutiter": [int, 2e3], # Maximum Number of Outer Loop Iterations (Major Iterations)
"maxinniter": [int, 2e2], # Maximum Number of Inner Loop Iterations (Minor Iterations)
"stopcriteria": [int, 1], # Stopping Criteria Flag
"stopiters": [
int,
10,
], # Consecutively Number of Outer Iterations for which the Stopping Criteria must be Satisfied
"etol": [float, 1e-6], # Absolute Tolerance for Equality constraints
"itol": [float, 1e-6], # Absolute Tolerance for Inequality constraints
"atol": [float, 1e-6], # Absolute Tolerance for Objective Function
"rtol": [float, 1e-6], # Relative Tolerance for Objective Function
"prtoutiter": [int, 0], # Number of Iterations Before Print Outer Loop Information
"prtinniter": [int, 0], # Number of Iterations Before Print Inner Loop Information
"xinit": [int, 0], # Initial Position Flag (0 - no position, 1 - position given)
"rinit": [float, 1.0], # Initial Penalty Factor
"fileout": [int, 1], # Flag to Turn On Output to filename
"filename": [
str,
"ALHSO.out",
], # We could probably remove fileout flag if filename or fileinstance is given
"seed": [float, 0], # Random Number Seed (0 - Auto-Seed based on time clock)
"scaling": [int, 1], # Design Variables Scaling Flag (0 - no scaling, 1 - scaling between [-1,1])
}
informs = {}
Optimizer.__init__(self, name, category, def_opts, informs, *args, **kwargs)
开发者ID:madebr,项目名称:pyOpt,代码行数:54,代码来源:pyALHSO.py
示例2: __init__
def __init__(self, pll_type=None, *args, **kwargs):
'''
FILTERSD Optimizer Class Initialization
**Keyword arguments:**
- pll_type -> STR: Parallel Implementation (None, 'POA'-Parallel Objective Analysis), *Default* = None
Documentation last updated: Feb. 16, 2010 - Peter W. Jansen
'''
#
if (pll_type == None):
self.poa = False
elif (pll_type.upper() == 'POA'):
self.poa = True
else:
raise ValueError("pll_type must be either None or 'POA'")
#end
#
name = 'FILTERSD'
category = 'Local Optimizer'
def_opts = {
'rho':[float,100.0], # initial trust region radius
'htol':[float,1e-6], # tolerance allowed in sum h of constraint feasibilities
'rgtol':[float,1e-5], # tolerance allowed in reduced gradient l2 norm
'maxit':[int,1000], # maximum number of major iterations allowed
'maxgr':[int,1e5], # upper limit on the number of gradient calls
'ubd':[float,1e5], # upper bound on the allowed constraint violation
'dchk':[int,0], # derivative check flag (0 - no check, 1 - check)
'dtol':[float,1e-8], # derivative check tolerance
'iprint':[int,1], # verbosity of printing (0 - none, 1 - Iter, 2 - Debug)
'iout':[int,6], # Output Unit Number
'ifile':[str,'FILTERSD.out'], # Output File Name
}
informs = {
-1 : 'ws not large enough',
-2 : 'lws not large enough',
-3 : 'inconsistency during derivative check',
0 : 'successful run',
1 : 'unbounded NLP (f <= fmin at an htol-feasible point)',
2 : 'bounds on x are inconsistent',
3 : 'local minimum of feasibility problem and h > htol, (nonlinear constraints are locally inconsistent)',
4 : 'initial point x has h > ubd (reset ubd or x and re-enter)',
5 : 'maxit major iterations have been carried out',
6 : 'termination with rho <= htol',
7 : 'not enough workspace in ws or lws (see message)',
8 : 'insufficient space for filter (increase mxf and re-enter)',
9 : 'unexpected fail in LCP solver',
10 : 'unexpected fail in LCP solver',
}
Optimizer.__init__(self, name, category, def_opts, informs, *args, **kwargs)
开发者ID:svn2github,项目名称:pyopt,代码行数:54,代码来源:pyFILTERSD.py
示例3: __init__
def __init__(self, pll_type=None, *args, **kwargs):
'''
PSQP Optimizer Class Initialization
**Keyword arguments:**
- pll_type -> STR: Parallel Implementation (None, 'POA'-Parallel Objective Analysis), *Default* = None
Documentation last updated: Feb. 16, 2010 - Peter W. Jansen
'''
#
if (pll_type == None):
self.poa = False
elif (pll_type.upper() == 'POA'):
self.poa = True
else:
raise ValueError("pll_type must be either None or 'POA'")
#end
#
name = 'PSQP'
category = 'Local Optimizer'
def_opts = {
'XMAX':[float,1e16], # Maximum Stepsize
'TOLX':[float,1e-16], # Variable Change Tolerance
'TOLC':[float,1e-6], # Constraint Violation Tolerance
'TOLG':[float,1e-6], # Lagrangian Gradient Tolerance
'RPF':[float,1e-4], # Penalty Coefficient
'MIT':[int,1000], # Maximum Number of Iterations
'MFV':[int,2000], # Maximum Number of Function Evaluations
'MET':[int,2], # Variable Metric Update (1 - BFGS, 2 - Hoshino)
'MEC':[int,2], # Negative Curvature Correction (1 - None, 2 - Powell's Correction)
'IPRINT':[int,2], # Output Level (0 - None, 1 - Final, 2 - Iter)
'IOUT':[int,6], # Output Unit Number
'IFILE':[str,'PSQP.out'], # Output File Name
}
informs = {
1 : 'Change in design variable was less than or equal to tolerance',
2 : 'Change in objective function was less than or equal to tolerance',
3 : 'Objective function less than or equal to tolerance',
4 : 'Maximum constraint value is less than or equal to tolerance',
11 : 'Maximum number of iterations exceeded',
12 : 'Maximum number of function evaluations exceeded',
13 : 'Maximum number of gradient evaluations exceeded',
-6 : 'Termination criterion not satisfied, but obtained point is acceptable',
#<0 : 'Method failed',
}
Optimizer.__init__(self, name, category, def_opts, informs, *args, **kwargs)
开发者ID:svn2github,项目名称:pyopt,代码行数:50,代码来源:pyPSQP.py
示例4: __init__
def __init__(self, pll_type=None, *args, **kwargs):
'''
SOLVOPT Optimizer Class Initialization
**Keyword arguments:**
- pll_type -> STR: Parallel Implementation (None, 'POA'-Parallel Objective Analysis), *Default* = None
Documentation last updated: Feb. 16, 2010 - Peter W. Jansen
'''
#
if (pll_type == None):
self.poa = False
elif (pll_type.upper() == 'POA'):
self.poa = True
else:
raise ValueError("pll_type must be either None or 'POA'")
#end
#
name = 'SOLVOPT'
category = 'Local Optimizer'
def_opts = {
'xtol':[float,1e-4], # Variables Tolerance
'ftol':[float,1e-6], # Objective Tolerance
'maxit':[int,15000], # Maximum Number of Iterations
'iprint':[int,1], # Output Level (-1 -> None, 0 -> Final, N - each Nth iter)
'gtol':[float,1e-8], # Constraints Tolerance
'spcdil':[float,2.5], # Space Dilation
'iout':[int,6], # Output Unit Number
'ifile':[str,'SOLVOPT.out'], # Output File Name
}
informs = {
1 : 'Normal termination.',
-2 : 'Improper space dimension.',
-3 : 'Objective equals infinity.',
-4 : 'Gradient equals zero or infinity.',
-5 : 'Objective equals infinity.',
-6 : 'Gradient equals zero or infinity.',
-7 : 'Objective function is unbounded.',
-8 : 'Gradient zero at the point, but stopping criteria are not fulfilled.',
-9 : 'Iterations limit exceeded.',
-11 : 'Premature stop is possible. Try to re-run the routine from the obtained point.',
-12 : 'Result may not provide the optimum. The function apparently has many extremum points.',
-13 : 'Result may be inaccurate in the coordinates. The function is flat at the optimum.',
-14 : 'Result may be inaccurate in a function value. The function is extremely steep at the optimum.',
}
Optimizer.__init__(self, name, category, def_opts, informs, *args, **kwargs)
开发者ID:madebr,项目名称:pyOpt,代码行数:50,代码来源:pySOLVOPT.py
示例5: __init__
def __init__(self, pll_type=None, *args, **kwargs):
'''
FSQP Optimizer Class Initialization
**Keyword arguments:**
- pll_type -> STR: Parallel Implementation (None, 'POA'-Parallel Objective Analysis), *Default* = None
Documentation last updated: Feb. 16, 2010 - Peter W. Jansen
'''
#
if (pll_type == None):
self.poa = False
elif (pll_type.upper() == 'POA'):
self.poa = True
else:
raise ValueError("pll_type must be either None or 'POA'")
#end
#
name = 'FSQP'
category = 'Local Optimizer'
def_opts = {
'mode':[int,100], # FSQP Mode (See Manual)
'iprint':[int,2], # Output Level (0 - None, 1 - Final, 2 - Major, 3 - Major Details)
'miter':[int,500], # Maximum Number of Iterations
'bigbnd':[float,1e10], # Plus Infinity Value
'epstol':[float,1e-8], # Convergence Tolerance
'epseqn':[float,0], # Equality Constraints Tolerance
'iout':[int,6], # Output Unit Number
'ifile':[str,'FSQP.out'], # Output File Name
}
informs = {
0 : 'Normal termination of execution',
1 : 'User-provided initial guess is infeasible for linear constraints, unable to generate a point satisfying all these constraints',
2 : 'User-provided initial guess is infeasible for nonlinear inequality constraints and linear constraints, unable to generate a point satisfying all these constraints',
3 : 'The maximum number of iterations has been reached before a solution is obtained',
4 : 'The line search fails to find a new iterate',
5 : 'Failure of the QP solver in attempting to construct d0, a more robust QP solver may succeed',
6 : 'Failure of the QP solver in attempting to construct d1, a more robust QP solver may succeed',
7 : 'Input data are not consistent, check print out error messages',
8 : 'Two consecutive iterates are numerically equivalent before a stopping criterion is satisfied',
9 : 'One of the penalty parameters exceeded bigbnd, the algorithm is having trouble satisfying a nonlinear equality constraint',
}
Optimizer.__init__(self, name, category, def_opts, informs, *args, **kwargs)
开发者ID:svn2github,项目名称:pyopt,代码行数:47,代码来源:pyFSQP.py
示例6: __init__
def __init__(self, pll_type=None, *args, **kwargs):
'''
SLSQP Optimizer Class Initialization
**Keyword arguments:**
- pll_type -> STR: Parallel Implementation (None, 'POA'-Parallel Objective Analysis), *Default* = None
Documentation last updated: Feb. 16, 2010 - Peter W. Jansen
'''
#
if (pll_type == None):
self.poa = False
elif (pll_type.upper() == 'POA'):
self.poa = True
else:
raise ValueError("pll_type must be either None or 'POA'")
#end
#
name = 'SLSQP'
category = 'Local Optimizer'
def_opts = {
# SLSQP Options
'ACC':[float,1e-6], # Convergence Accurancy
'MAXIT':[int,50], # Maximum Iterations
'IPRINT':[int,1], # Output Level (<0 - None, 0 - Screen, 1 - File)
'IOUT':[int,6], # Output Unit Number
'IFILE':[str,'SLSQP.out'], # Output File Name
}
informs = {
-1 : "Gradient evaluation required (g & a)",
0 : "Optimization terminated successfully.",
1 : "Function evaluation required (f & c)",
2 : "More equality constraints than independent variables",
3 : "More than 3*n iterations in LSQ subproblem",
4 : "Inequality constraints incompatible",
5 : "Singular matrix E in LSQ subproblem",
6 : "Singular matrix C in LSQ subproblem",
7 : "Rank-deficient equality constraint subproblem HFTI",
8 : "Positive directional derivative for linesearch",
9 : "Iteration limit exceeded",
}
Optimizer.__init__(self, name, category, def_opts, informs, *args, **kwargs)
开发者ID:hschilling,项目名称:pyOpt,代码行数:46,代码来源:pySLSQP.py
示例7: __init__
def __init__(self, pll_type=None, *args, **kwargs):
'''
ALGENCAN Optimizer Class Initialization
**Keyword arguments:**
- pll_type -> STR: Parallel Implementation (None, 'POA'-Parallel Objective Analysis), *Default* = None
Documentation last updated: Feb. 16, 2010 - Peter W. Jansen
'''
#
if (pll_type == None):
self.poa = False
elif (pll_type.upper() == 'POA'):
self.poa = True
else:
raise ValueError("pll_type must be either None or 'POA'")
#end
#
name = 'ALGENCAN'
category = 'Local Optimizer'
def_opts = {
# ALGENCAN Options
'epsfeas':[float,1.0e-8], # Feasibility Convergence Accurancy
'epsopt':[float,1.0e-8], # Optimality Convergence Accurancy
'efacc':[float,1.0e-4], # Feasibility Level for Newton-KKT Acceleration
'eoacc':[float,1.0e-4], # Optimality Level for Newton-KKT Acceleration
'checkder':[bool,False], # Check Derivatives Flag
'iprint':[int,10], # Print Flag (0 - None, )
'ifile':[str,'ALGENCAN.out'], # Output File Name
'ncomp':[int,6], # Print Precision
}
informs = {
0 : "Solution was found.",
1 : "Stationary or infeasible point was found.",
2 : "penalty parameter is too large infeasibile or badly scaled problem",
3 : "Maximum of iterations reached.",
}
Optimizer.__init__(self, name, category, def_opts, informs, *args, **kwargs)
开发者ID:madebr,项目名称:pyOpt,代码行数:42,代码来源:pyALGENCAN.py
示例8: __init__
def __init__(self, pll_type=None, *args, **kwargs):
'''
MMFD Optimizer Class Initialization
**Keyword arguments:**
- pll_type -> STR: Parallel Implementation (None, 'POA'-Parallel Objective Analysis), *Default* = None
Documentation last updated: Feb. 16, 2010 - Peter W. Jansen
'''
#
if (pll_type == None):
self.poa = False
elif (pll_type.upper() == 'POA'):
self.poa = True
else:
raise ValueError("pll_type must be either None or 'POA'")
#end
#
name = 'MMFD'
category = 'Local Optimizer'
def_opts = {
'IOPT':[int,0], # Feasible Directions Approach (0 - MMFD, 1 - MFD)
'IONED':[int,0], # One-Dimensional Search Method (0,1,2,3)
'CT':[float,-3e-2], # Constraint Tolerance
'CTMIN':[float,4e-3], # Active Constraint Tolerance
'DABOBJ':[float,1e-3], # Objective Absolute Tolerance (DABOBJ*abs(f(x)))
'DELOBJ':[float,1e-3], # Objective Relative Tolerance
'THETAZ':[float,1e-1], # Push-Off Factor
'PMLT':[float,1e1], # Penalty multiplier for equality constraints
'ITMAX':[int,4e2], # Maximum Number of Iterations
'ITRMOP':[int,3], # consecutive Iterations Iterations for Convergence
'IPRINT':[int,2], # Print Control (0 - None, 1 - Final, 2 - Iters)
'IFILE':[str,'MMFD.out'], # Output File Name
}
informs = {
}
Optimizer.__init__(self, name, category, def_opts, informs, *args, **kwargs)
开发者ID:hschilling,项目名称:pyOpt,代码行数:41,代码来源:pyMMFD.py
示例9: __init__
def __init__(self, pll_type=None, *args, **kwargs):
'''
MMA Optimizer Class Initialization
**Keyword arguments:**
- pll_type -> STR: Parallel Implementation (None, 'POA'-Parallel Objective Analysis), *Default* = None
Documentation last updated: Feb. 16, 2010 - Peter W. Jansen
'''
#
if (pll_type == None):
self.poa = False
elif (pll_type.upper() == 'POA'):
self.poa = True
else:
raise ValueError("pll_type must be either None or 'POA'")
#end
#
name = 'MMA'
category = 'Local Optimizer'
def_opts = {
# MMA Options
'MAXIT':[int,1000], # Maximum Iterations
'GEPS':[float,1e-6], # Dual Objective Gradient Tolerance
'DABOBJ':[float,1e-6], #
'DELOBJ':[float,1e-6], #
'ITRM':[int,2], #
'IPRINT':[int,1], # Output Level (<0 - None, 0 - Screen, 1 - File)
'IOUT':[int,6], # Output Unit Number
'IFILE':[str,'MMA.out'], # Output File Name
}
informs = {
0 : 'The optimality conditions are satisfied.',
1 : 'The algorithm has been stopped after MAXIT iterations.',
}
Optimizer.__init__(self, name, category, def_opts, informs, *args, **kwargs)
开发者ID:svn2github,项目名称:pyopt,代码行数:41,代码来源:pyMMA.py
示例10: __init__
def __init__(self, pll_type=None, *args, **kwargs):
'''
NSGA2 Optimizer Class Initialization
**Keyword arguments:**
- pll_type -> STR: Parallel Implementation (None, 'POA'-Parallel Objective Analysis), *Default* = None
Documentation last updated: Feb. 16, 2010 - Peter W. Jansen
'''
#
if (pll_type == None):
self.poa = False
elif (pll_type.upper() == 'POA'):
self.poa = True
else:
raise ValueError("pll_type must be either None or 'POA'")
#end
#
name = 'NSGA-II'
category = 'Global Optimizer'
def_opts = {
'PopSize':[int,100], #
'maxGen':[int,150], #
'pCross_real':[float,0.6], #
'pMut_real':[float,0.2], #
'eta_c':[float,10], #
'eta_m':[float,20], #
'pCross_bin':[float,0], #
'pMut_bin':[float,0], #
'PrintOut':[int,1], # Flag to Turn On Output to filename (0 - , 1 - , 2 - )
'seed':[float,0], # Random Number Seed (0 - Auto-Seed based on time clock)
'xinit':[int,0], # Use Initial Solution Flag (0 - random population, 1 - use given solution)
}
informs = {}
Optimizer.__init__(self, name, category, def_opts, informs, *args, **kwargs)
开发者ID:madebr,项目名称:pyOpt,代码行数:39,代码来源:pyNSGA2.py
示例11: __init__
def __init__(self, pll_type=None, *args, **kwargs):
'''
COBYLA Optimizer Class Initialization
**Keyword arguments:**
- pll_type -> STR: Parallel Implementation (None, 'POA'-Parallel Objective Analysis), *Default* = None
Documentation last updated: Feb. 16, 2010 - Peter W. Jansen
'''
#
if (pll_type == None):
self.poa = False
elif (pll_type.upper() == 'POA'):
self.poa = True
else:
raise ValueError("pll_type must be either None or 'POA'")
#end
#
name = 'COBYLA'
category = 'Local Optimizer'
def_opts = {
'RHOBEG':[float,0.5], # Initial Variables Change
'RHOEND':[float,1.0e-6], # Convergence Accurancy
'IPRINT':[int,2], # Print Flag (0 - None, 1 - Final, 2,3 - Iteration)
'MAXFUN':[int,3500], # Maximum Iterations
'IOUT':[int,6], # Output Unit Number
'IFILE':[str,'COBYLA.out'], # Output File Name
}
informs = {
0: 'Normal return',
1: 'Max. number of function evaluations reach',
2: 'Rounding errors are becoming damaging',
}
Optimizer.__init__(self, name, category, def_opts, informs, *args, **kwargs)
开发者ID:madebr,项目名称:pyOpt,代码行数:38,代码来源:pyCOBYLA.py
示例12: __init__
def __init__(self, *args, **kwargs):
'''
HSO Optimizer Class Initialization
Documentation last updated: October. 22, 2008 - Ruben E. Perez
'''
#
name = 'HSO'
category = 'Global Optimizer'
def_opts = {
'hms':[int,10], # Memory Size [4,10]
'dbw':[float,0.01], #
'hmcr':[float,0.96], #
'par':[float,0.6], #
'maxiter':[int,1e4], # Maximum Number Iterations
'printout':[int,0], # Flag to Turn On Information Output
'xinit':[int,0], # Initial Position Flag (0 - no position, 1 - position given)
'seed':[float,0], # Random Number Seed (0 - Auto-Seed based on time clock)
}
informs = {}
Optimizer.__init__(self, name, category, def_opts, informs, *args, **kwargs)
开发者ID:hschilling,项目名称:pyOpt,代码行数:23,代码来源:pyALHSO.py
示例13: __init__
def __init__(self, pll_type=None, *args, **kwargs):
'''
CONMIN Optimizer Class Initialization
**Keyword arguments:**
- pll_type -> STR: Parallel Implementation (None, 'POA'-Parallel Objective Analysis), *Default* = None
Documentation last updated: Feb. 16, 2010 - Peter W. Jansen
'''
#
if (pll_type == None):
self.poa = False
elif (pll_type.upper() == 'POA'):
self.poa = True
else:
raise ValueError("pll_type must be either None or 'POA'")
#end
#
name = 'CONMIN'
category = 'Local Optimizer'
def_opts = {
'ITMAX':[int,1e4], # Maximum Number of Iterations
'DELFUN':[float,1e-6], # Objective Relative Tolerance
'DABFUN':[float,1e-6], # Objective Absolute Tolerance
'ITRM':[int,2], #
'NFEASCT':[int,20], #
'IPRINT':[int,2], # Print Control (0 - None, 1 - Final, 2,3,4,5 - Debug)
'IOUT':[int,6], # Output Unit Number
'IFILE':[str,'CONMIN.out'], # Output File Name
}
informs = {
}
Optimizer.__init__(self, name, category, def_opts, informs, *args, **kwargs)
开发者ID:hschilling,项目名称:pyOpt,代码行数:37,代码来源:pyCONMIN.py
示例14: __init__
def __init__(self, pll_type=None, *args, **kwargs):
'''
SDPEN Optimizer Class Initialization
**Keyword arguments:**
- pll_type -> STR: Parallel Implementation (None, 'POA'-Parallel Objective Analysis), *Default* = None
Documentation last updated: August. 09, 2012 - Ruben E. Perez
'''
#
if (pll_type == None):
self.poa = False
elif (pll_type.upper() == 'POA'):
self.poa = True
else:
raise ValueError("pll_type must be either None or 'POA'")
#end
#
name = 'SDPEN'
category = 'Local Optimizer'
def_opts = {
# SDPEN Options
'alfa_stop':[float,1e-6], # Convergence Tolerance
'nf_max':[int,5000], # Maximum Number of Function Evaluations
'iprint':[int,0], # Output Level (<0 - None, 0 - Final, 1 - Iters, 2 - Full)
'iout':[int,6], # Output Unit Number
'ifile':[str,'SDPEN.out'], # Output File Name
}
informs = {
1 : 'finished successfully',
2 : 'maximum number of evaluations reached',
}
Optimizer.__init__(self, name, category, def_opts, informs, *args, **kwargs)
开发者ID:svn2github,项目名称:pyopt,代码行数:37,代码来源:pySDPEN.py
示例15: __init__
def __init__(self, pll_type=None, *args, **kwargs):
"""
CONMIN Optimizer Class Initialization
**Keyword arguments:**
- pll_type -> STR: Parallel Implementation (None, 'POA'-Parallel Objective Analysis), *Default* = None
Documentation last updated: Feb. 16, 2010 - Peter W. Jansen
"""
#
if pll_type == None:
self.poa = False
elif pll_type.upper() == "POA":
self.poa = True
else:
raise ValueError("pll_type must be either None or 'POA'")
# end
#
name = "CONMIN"
category = "Local Optimizer"
def_opts = {
"ITMAX": [int, 1e4], # Maximum Number of Iterations
"DELFUN": [float, 1e-6], # Objective Relative Tolerance
"DABFUN": [float, 1e-6], # Objective Absolute Tolerance
"ITRM": [int, 2], #
"NFEASCT": [int, 20], #
"IPRINT": [int, 2], # Print Control (0 - None, 1 - Final, 2,3,4,5 - Debug)
"IOUT": [int, 6], # Output Unit Number
"IFILE": [str, "CONMIN.out"], # Output File Name
}
informs = {}
Optimizer.__init__(self, name, category, def_opts, informs, *args, **kwargs)
开发者ID:madebr,项目名称:pyOpt,代码行数:36,代码来源:pyCONMIN.py
示例16: __init__
def __init__(self, pll_type=None, *args, **kwargs):
'''
KSOPT Optimizer Class Initialization
**Keyword arguments:**
- pll_type -> STR: Parallel Implementation (None, 'POA'-Parallel Objective Analysis), *Default* = None
Documentation last updated: Feb. 16, 2010 - Peter W. Jansen
'''
#
if (pll_type == None):
self.poa = False
elif (pll_type.upper() == 'POA'):
self.poa = True
else:
raise ValueError("pll_type must be either None or 'POA'")
#end
#
name = 'KSOPT'
category = 'Local Optimizer'
def_opts = {
'ITMAX':[int,4e2], # Maximum Number of Iterations
'RDFUN':[float,1e-4], # Objective Convergence Relative Tolerance
'RHOMIN':[float,5.0], # Initial KS multiplier
'RHOMAX':[float,100.0], # Final KS multiplier
'IPRINT':[int,2], # Print Control (0 - None, 1 - Final, 2 - Iters)
'IOUT':[int,6], # Output Unit Number
'IFILE':[str,'KSOPT.out'], # Output File Name
}
informs = {
}
Optimizer.__init__(self, name, category, def_opts, informs, *args, **kwargs)
开发者ID:svn2github,项目名称:pyopt,代码行数:36,代码来源:pyKSOPT.py
示例17: __init__
def __init__(self, pll_type=None, *args, **kwargs):
'''
MIDACO Optimizer Class Initialization
**Keyword arguments:**
- pll_type -> STR: Parallel Implementation (None, 'POA'-Parallel Objective Analysis), *Default* = None
Documentation last updated: Feb. 16, 2010 - Peter W. Jansen
'''
#
if (pll_type == None):
self.poa = False
self.spm = False
elif (pll_type.upper() == 'POA'):
self.poa = True
self.spm = False
elif (pll_type.upper() == 'SPM'):
self.poa = False
self.spm = True
else:
raise ValueError("pll_type must be either None, 'POA' or 'SPM'")
#end
#
name = 'MIDACO'
category = 'Global Optimizer'
def_opts = {
# MIDACO Options
'ACC':[float,0], # Accuracy for constraint violation (0 - default)
'ISEED':[int,0], # Seed for random number generator (e.g. ISEED = 0,1,2,3,...)
'FSTOP':[int,0], # Objective Function Stopping Value (0 - disabled)
'AUTOSTOP':[int,0], # Automatic stopping criteria (0 - disable, 1 to 500 - from local to global)
'ORACLE':[float,0], # Oracle parameter for constrained problems (0 - Use internal default)
'FOCUS':[int,0], # Focus of MIDACO search process around best solution (0 - Use internal default)
'ANTS':[int,0], # Number of iterates (ants) per generation (0 - Use internal default)
'KERNEL':[int,0], # Size of the solution archive (0 - Use internal default)
'CHARACTER':[int,0], # Internal custom parameters (0 - Use internal default, 1 - IP problems, 2 - NLP problems, 3 - MINLP problems)
'MAXEVAL':[int,10000], # Maximum function evaluations
'MAXTIME':[int,86400], # Maximum time limit, in seconds
'IPRINT':[int,1], # Output Level (<0 - None, 0 - Screen, 1 - File(s))
'PRINTEVAL':[int,1000], # Print-Frequency for current best solution
'IOUT1':[int,36], # History output unit number
'IOUT2':[int,37], # Best solution output unit number
'IFILE1':[str,'MIDACO_HIST.out'], # History output file name
'IFILE2':[str,'MIDACO_BEST.out'], # Best output file name
'LKEY':[str,'MIDACO_LIMITED_VERSION___[CREATIVE_COMMONS_BY-NC-ND_LICENSE]'],
}
informs = {
1 : 'Feasible solution, MIDACO was stopped by the user submitting ISTOP=1',
2 : 'Infeasible solution, MIDACO was stopped by the user submitting ISTOP=1',
3 : 'Feasible solution, MIDACO stopped automatically using AUTOSTOP option',
4 : 'Infeasible solution, MIDACO stopped automatically using AUTOSTOP option',
5 : 'Feasible solution, MIDACO stopped automatically by FSTOP',
51 : 'WARNING: Some X(i) is greater/lower than +/- 1.0D+12 (try to avoid huge values!)',
52 : 'WARNING: Some XL(i) is greater/lower than +/- 1.0D+12 (try to avoid huge values!)',
53 : 'WARNING: Some XU(i) is greater/lower than +/- 1.0D+12 (try to avoid huge values!)',
61 : 'WARNING: Some X(i) should be discrete (e.g. 1.000) , but is continuous (e.g. 1.234)',
62 : 'WARNING: Some XL(i) should be discrete (e.g. 1.000) , but is continuous (e.g. 1.234)',
63 : 'WARNING: Some XU(i) should be discrete (e.g. 1.000) , but is continuous (e.g. 1.234)',
71 : 'WARNING: Some XL(i) = XU(I) (fixed variable)',
81 : 'WARNING: F(X) has value NaN for starting point X (sure your problem is correct?)',
82 : 'WARNING: Some G(X) has value NaN for starting point X (sure your problem is correct?)',
91 : 'WARNING: FSTOP is greater/lower than +/- 1.0D+8',
92 : 'WARNING: ORACLE is greater/lower than +/- 1.0D+8',
101 : 'ERROR: L <= 0 or L > 1.0D+6',
102 : 'ERROR: N <= 0 or N > 1.0D+6',
103 : 'ERROR: NINT < 0',
104 : 'ERROR: NINT > N',
105 : 'ERROR: M < 0 or M > 1.0D+6',
106 : 'ERROR: ME < 0',
107 : 'ERROR: ME > M',
201 : 'ERROR: some X(i) has type NaN',
202 : 'ERROR: some XL(i) has type NaN',
203 : 'ERROR: some XU(i) has type NaN',
204 : 'ERROR: some X(i) < XL(i)',
205 : 'ERROR: some X(i) > XU(i)',
206 : 'ERROR: some XL(i) > XU(i)',
301 : 'ERROR: ACC < 0 or ACC > 1.0D+6',
302 : 'ERROR: ISEED < 0 or ISEED > 1.0D+12',
303 : 'ERROR: FSTOP greater/lower than +/- 1.0D+12',
304 : 'ERROR: AUTOSTOP < 0 or AUTOSTOP > 1.0D+6',
305 : 'ERROR: ORACLE greater/lower than +/- 1.0D+12',
306 : 'ERROR: |FOCUS| < 1 or FOCUS > 1.0D+12',
307 : 'ERROR: ANTS < 0 or ANTS > 1.0D+8',
308 : 'ERROR: KERNEL < 0 or KERNEL > 100',
309 : 'ERROR: ANTS < KERNEL',
310 : 'ERROR: ANTS > 0 but KERNEL = 0',
311 : 'ERROR: KERNEL > 0 but ANTS = 0',
312 : 'ERROR: CHARACTER < 0 or CHARACTER > 1000',
313 : 'ERROR: some MIDACO parameters has type NaN',
401 : 'ERROR: ISTOP < 0 or ISTOP > 1',
501 : 'ERROR: Double precision work space size LRW is too small (see below LRW), RW must be at least of size LRW = 200*N+2*M+1000',
601 : 'ERROR: Integer work space size LIW is too small (see below LIW), IW must be at least of size LIW = 2*N+L+100',
701 : 'ERROR: Input check failed! MIDACO must be called initially with IFAIL = 0',
801 : 'ERROR: L > LMAX (user must specifiy LMAX below in the MIDACO source code)',
802 : 'ERROR: L*M+1 > LXM (user must specifiy LXM below in the MIDACO source code)',
900 : 'ERROR: Invalid or corrupted LICENSE_KEY',
#.........这里部分代码省略.........
开发者ID:madebr,项目名称:pyOpt,代码行数:101,代码来源:pyMIDACO.py
示例18: __init__
def __init__(self, pll_type=None, *args, **kwargs):
"""IPOPT Optimizer Class Initialization.
Documentation last updated: Feb. 16, 2010 - Peter W. Jansen
"""
name = "IPOPT"
category = "Local Optimizer"
def_opts = {
# IPOPT Printing Options
# Print Control (0 - None, 1 - Final,2,3,4,5 - Debug)
"IPRINT": [int, 2],
"IOUT": [int, 6], # Output Unit Number
"output_file": [str, "IPOPT.out"], # Output File Name
# Output options
"print_level": [int, 5], # Output verbosity level
# Print all options set by the user
"print_user_options": [str, "no"],
# Switch to print all algorithmic options
"print_options_documentation": [str, "no"],
"output_file": [str, ""], # File name of desired output file
"file_print_level": [int, 5], # Verbosity level for output file
"option_file_name": [str, ""], # File name of options file
# Termination options
"tol": [float, 1e-8], # relative convergence tolerance
"max_iter": [int, 3000], # Maximum number of iterations
"max_cpu_time": [float, 1e6], # Maximum number of CPU seconds.
# Desired threshold for the dual infeasibility
"dual_inf_tol": [float, 1],
# Desired threshold for the constraint violation
"constr_viol_tol": [float, 1e-4],
# Desired threshold for the complementarity conditions
"compl_inf_tol": [float, 1e-4],
# "Acceptable" convergence tolerance (relative)
"acceptable_tol": [float, 1e-6],
# Number of "acceptable" iterates before triggering termination
"acceptable_iter": [int, 15],
# "Acceptance" threshold for the constraint violation
"acceptable_constr_viol_tol": [float, 1e-2],
# "Acceptance" threshold for the dual infeasibility.
"acceptable_dual_inf_tol": [float, 1e10],
# "Acceptance" threshold for the complementarity conditions
"acceptable_compl_inf_tol": [float, 1e-2],
# "Acceptance" stopping criterion based on objective function change
"acceptable_obj_change_tol": [float, 1e20],
# Threshold for maximal value of primal iterates
"diverging_iterates_tol": [float, 1e20],
# NLP scaling options
# Scaling factor for the objective function
"obj_scaling_factor": [float, 1],
# Select the technique use for scaling the NLP ('none',
# 'user-scaling', 'gradient-based', 'equilibration-based')
"nlp_scaling_method": [str, "gradient-based"],
# Maximum gradient after NLP scaling
"nlp_scaling_max_gradient": [float, 100],
# Minimum value of gradient-based scaling values
"nlp_scaling_min_value": [float, 1e-8],
# NLP options
# Factor for initial relaxation of the bounds
"bound_relax_factor": [float, 1e-8],
# Indicates whether final points should be projected into original
# bounds
"honor_original_bounds": [str, "yes"],
# Indicates whether it is desired to check for Nan/Inf in derivative
# matrices
"check_derivatives_for_naninf": [str, "no"],
# any bound less or equal this value will be considered -inf (i.e.
# not lower bounded)
"nlp_lower_bound_inf": [float, -1e19],
# any bound greater or this value will be considered +inf (i.e. not
# upper bounded)
"nlp_upper_bound_inf": [float, 1e19],
# Determines how fixed variables should be handled
# ('make_parameter', 'make_constraint', 'relax_bounds')
"fixed_variable_treatment": [str, "make_parameter"],
# Indicates whether all equality constraints are linear
"jac_c_constant": [str, "no"],
# Indicates whether all inequality constraints are linear
"jac_d_constant": [str, "no"],
# Indicates whether the problem is a quadratic problem
"hessian_constant": [str, "no"],
# Initialization options
# Desired minimum relative distance from the initial point to bound
"bound_frac": [float, 0.01],
# Desired minimum absolute distance from the initial point to bound
"bound_push": [float, 0.01],
# Desired minimum relative distance from the initial slack to bound
"slack_bound_frac": [float, 0.01],
# Desired minimum absolute distance from the initial slack to bound
"slack_bound_push": [float, 0.01],
# Initial value for the bound multipliers
"bound_mult_init_val": [float, 1],
# Maximum allowed least-square guess of constraint multipliers
"constr_mult_init_max": [float, 1000],
# Initialization method for bound multipliers ('constant',
# 'mu_based')
"bound_mult_init_method": [str, "constant"],
# Barrier parameter options
# Indicates if we want to do Mehrotra's algorithm
"mehrotra_algorithm": [str, "no"],
#.........这里部分代码省略.........
开发者ID:syarra,项目名称:pyOpt-pyIPOPT,代码行数:101,代码来源:pyIPOPT.py
示例19: __init__
def __init__(self, pll_type=None, *args, **kwargs):
"""
SNOPT Optimizer Class Initialization
**Keyword arguments:**
- pll_type -> STR: Parallel Implementation (None, 'POA'-Parallel Objective Analysis), *Default* = None
Documentation last updated: Feb. 16, 2010 - Peter W. Jansen
"""
#
if pll_type == None:
self.poa = False
elif pll_type.upper() == "POA":
self.poa = True
else:
raise ValueError("pll_type must be either None or 'POA'")
# end
#
name = "SNOPT"
category = "Local Optimizer"
def_opts = {
# SNOPT Printing Options
"Major print level": [int, 1], # Majors Print (1 - line major iteration log)
"Minor print level": [int, 1], # Minors Print (1 - line minor iteration log)
"Print file": [str, "SNOPT_print.out"], # Print File Name (specified by subroutine snInit)
"iPrint": [int, 18], # Print File Output Unit (override internally in snopt?)
"Summary file": [str, "SNOPT_summary.out"], # Summary File Name (specified by subroutine snInit)
"iSumm": [int, 19], # Summary File Output Unit (override internally in snopt?)
"Print frequency": [int, 100], # Minors Log Frequency on Print File
"Summary frequency": [int, 100], # Minors Log Frequency on Summary File
"Solution": [str, "Yes"], # Print Solution on the Print File
"Suppress options listing": [type(None), None], # (options are normally listed)
"System information": [str, "No"], # Print System Information on the Print File
# SNOPT Problem Specification Options
"Problem Type": [
str,
"Minimize",
], # ('Maximize': alternative over Minimize, 'Feasible point': alternative over Minimize or Maximize)
"Objective row": [int, 1], # (has precedence over ObjRow (snOptA))
"Infinite bound": [float, 1.0e20], # Infinite Bound Value
# SNOPT Convergence Tolerances Options
"Major feasibility tolerance": [float, 1.0e-6], # Target Nonlinear Constraint Violation
"Major optimality tolerance": [float, 1.0e-6], # Target Complementarity Gap
"Minor feasibility tolerance": [float, 1.0e-6], # For Satisfying the QP Bounds
|
请发表评论