New top farm problem structure
New TopFarmProblem structure.
The different TopFarmProblems (TurbineTypeOptimizationProblem
, TurbineXYZOptimizationProblem
, TurbineTypeXYZOptimizationProblem
and TopFarm
) has been simplified to only TopFarmProblem that now takes the following input:
- design_vars : dict Design variables for the problem. Ex. {'x': [1,2,3], 'y':([3,2,1],0,1), 'z':([4,5,6],[4,5,4], [6,7,6])} The keys ('x', 'y') is the names of the design variable and the values are either the initial value or a tuple of (initial value, lower bound, upper bound)
- cost_comp : ExplicitComponent or TopFarmProblem Component calculating the cost. See CostModelComponent to wrap pure python functions. For nested problems, this is typically a TopFarmProblem
- driver : openmdao Driver, optinal Driver for the optimization See examples in topfarm.easy_drivers
- constraints : list of Constraint-objects E.g. XYBoundaryConstraint, SpacingConstraint
- plot_comp : ExplicitComponent, optional Component used to plot state (during optimization)
- record_id : string "<record_id>:", optional
Used to continue on previous optimization
record_id can be name (saves as recordings/.pkl), abs or relative path
Case can be:
- "", "latest", "-1": Continue from latest
- "best": Continue from best case (minimum cost)
- "0": Start from scratch (initial position)
- "4": Start from case number 4
- Expected_cost : int or float Used to scale the cost. This has influence on some drivers, e.g. SLSQP where it affects the step size
This should simplify things a little.
I have moved the doc examples to /examples/docs and put them inside a main()
+ added a test that runs the examples
Edited by Mads M. Pedersen