forked from dartsim/dart
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoptimizer.pyi
More file actions
270 lines (270 loc) · 10.1 KB
/
optimizer.pyi
File metadata and controls
270 lines (270 loc) · 10.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
from __future__ import annotations
import numpy
import typing
__all__: list[str] = ['Function', 'GradientDescentSolver', 'GradientDescentSolverProperties', 'GradientDescentSolverUniqueProperties', 'ModularFunction', 'MultiFunction', 'NullFunction', 'Problem', 'Solver', 'SolverProperties']
M = typing.TypeVar("M", bound=int)
class Function:
@typing.overload
def __init__(self) -> None:
...
@typing.overload
def __init__(self, name: str) -> None:
...
def getName(self) -> str:
...
def setName(self, newName: str) -> None:
...
class ModularFunction(Function):
@typing.overload
def clearCostFunction(self) -> None:
...
@typing.overload
def clearCostFunction(self, printWarning: bool) -> None:
...
def clearGradientFunction(self) -> None:
...
def clearHessianFunction(self) -> None:
...
def eval(self, x: numpy.ndarray[tuple[M, typing.Literal[1]], numpy.dtype[numpy.float64]]) -> float:
...
def setCostFunction(self, cost: ...) -> None:
...
def setGradientFunction(self, gradient: ...) -> None:
...
def setHessianFunction(self, hessian: ...) -> None:
...
class MultiFunction:
pass
class NullFunction(Function):
def eval(self, arg0_: numpy.ndarray[tuple[M, typing.Literal[1]], numpy.dtype[numpy.float64]]) -> float:
...
class Problem:
@typing.overload
def __init__(self) -> None:
...
@typing.overload
def __init__(self, dim: int) -> None:
...
def addEqConstraint(self, eqConst: Function) -> None:
...
def addIneqConstraint(self, ineqConst: Function) -> None:
...
def addSeed(self, seed: numpy.ndarray[tuple[M, typing.Literal[1]], numpy.dtype[numpy.float64]]) -> None:
...
def clearAllSeeds(self) -> None:
...
def getDimension(self) -> int:
...
def getEqConstraint(self, idx: int) -> Function:
...
def getIneqConstraint(self, idx: int) -> Function:
...
def getInitialGuess(self) -> numpy.ndarray[tuple[M, typing.Literal[1]], numpy.dtype[numpy.float64]]:
...
def getNumEqConstraints(self) -> int:
...
def getNumIneqConstraints(self) -> int:
...
def getObjective(self) -> Function:
...
def getOptimalSolution(self) -> numpy.ndarray[tuple[M, typing.Literal[1]], numpy.dtype[numpy.float64]]:
...
def getOptimumValue(self) -> float:
...
def removeAllEqConstraints(self) -> None:
...
def removeAllIneqConstraints(self) -> None:
...
def removeEqConstraint(self, eqConst: Function) -> None:
...
def removeIneqConstraint(self, ineqConst: Function) -> None:
...
def setDimension(self, dim: int) -> None:
...
def setInitialGuess(self, initGuess: numpy.ndarray[tuple[M, typing.Literal[1]], numpy.dtype[numpy.float64]]) -> None:
...
def setLowerBounds(self, lb: numpy.ndarray[tuple[M, typing.Literal[1]], numpy.dtype[numpy.float64]]) -> None:
...
def setObjective(self, obj: Function) -> None:
...
def setOptimalSolution(self, optParam: numpy.ndarray[tuple[M, typing.Literal[1]], numpy.dtype[numpy.float64]]) -> None:
...
def setOptimumValue(self, val: float) -> None:
...
def setUpperBounds(self, ub: numpy.ndarray[tuple[M, typing.Literal[1]], numpy.dtype[numpy.float64]]) -> None:
...
class SolverProperties:
mIterationsPerPrint: int
mNumMaxIterations: int
mOutStream: ...
mPrintFinalResult: bool
mProblem: ...
mResultFile: str
mTolerance: float
@typing.overload
def __init__(self) -> None:
...
@typing.overload
def __init__(self, problem: ...) -> None:
...
@typing.overload
def __init__(self, problem: ..., tolerance: float) -> None:
...
@typing.overload
def __init__(self, problem: ..., tolerance: float, numMaxIterations: int) -> None:
...
@typing.overload
def __init__(self, problem: ..., tolerance: float, numMaxIterations: int, iterationsPerPrint: int) -> None:
...
@typing.overload
def __init__(self, problem: ..., tolerance: float, numMaxIterations: int, iterationsPerPrint: int, ostream: ...) -> None:
...
@typing.overload
def __init__(self, problem: ..., tolerance: float, numMaxIterations: int, iterationsPerPrint: int, ostream: ..., printFinalResult: bool) -> None:
...
@typing.overload
def __init__(self, problem: ..., tolerance: float, numMaxIterations: int, iterationsPerPrint: int, ostream: ..., printFinalResult: bool, resultFile: str) -> None:
...
class Solver:
@typing.overload
def __init__(self) -> None:
...
@typing.overload
def __init__(self, properties: SolverProperties) -> None:
...
@typing.overload
def __init__(self, problem: ...) -> None:
...
def clone(self) -> Solver:
...
def getIterationsPerPrint(self) -> int:
...
def getNumMaxIterations(self) -> int:
...
def getPrintFinalResult(self) -> bool:
...
def getProblem(self) -> ...:
...
def getResultFileName(self) -> str:
...
def getTolerance(self) -> float:
...
def getType(self) -> str:
...
def setIterationsPerPrint(self, newRatio: int) -> None:
...
def setNumMaxIterations(self, newMax: int) -> None:
...
def setOutStream(self, os: ...) -> None:
...
def setPrintFinalResult(self, print: bool) -> None:
...
def setProblem(self, newProblem: ...) -> None:
...
def setProperties(self, properties: SolverProperties) -> None:
...
def setResultFileName(self, resultFile: str) -> None:
...
def setTolerance(self, newTolerance: float) -> None:
...
def solve(self) -> bool:
...
class GradientDescentSolverUniqueProperties:
mDefaultConstraintWeight: float
mEqConstraintWeights: numpy.ndarray[tuple[M, typing.Literal[1]], numpy.dtype[numpy.float64]]
mIneqConstraintWeights: numpy.ndarray[tuple[M, typing.Literal[1]], numpy.dtype[numpy.float64]]
mMaxAttempts: int
mMaxPerturbationFactor: float
mMaxRandomizationStep: float
mPerturbationStep: int
mStepSize: float
@typing.overload
def __init__(self) -> None:
...
@typing.overload
def __init__(self, stepMultiplier: float) -> None:
...
@typing.overload
def __init__(self, stepMultiplier: float, maxAttempts: int) -> None:
...
@typing.overload
def __init__(self, stepMultiplier: float, maxAttempts: int, perturbationStep: int) -> None:
...
@typing.overload
def __init__(self, stepMultiplier: float, maxAttempts: int, perturbationStep: int, maxPerturbationFactor: float) -> None:
...
@typing.overload
def __init__(self, stepMultiplier: float, maxAttempts: int, perturbationStep: int, maxPerturbationFactor: float, maxRandomizationStep: float) -> None:
...
@typing.overload
def __init__(self, stepMultiplier: float, maxAttempts: int, perturbationStep: int, maxPerturbationFactor: float, maxRandomizationStep: float, defaultConstraintWeight: float) -> None:
...
@typing.overload
def __init__(self, stepMultiplier: float, maxAttempts: int, perturbationStep: int, maxPerturbationFactor: float, maxRandomizationStep: float, defaultConstraintWeight: float, eqConstraintWeights: numpy.ndarray[tuple[M, typing.Literal[1]], numpy.dtype[numpy.float64]]) -> None:
...
@typing.overload
def __init__(self, stepMultiplier: float, maxAttempts: int, perturbationStep: int, maxPerturbationFactor: float, maxRandomizationStep: float, defaultConstraintWeight: float, eqConstraintWeights: numpy.ndarray[tuple[M, typing.Literal[1]], numpy.dtype[numpy.float64]], ineqConstraintWeights: numpy.ndarray[tuple[M, typing.Literal[1]], numpy.dtype[numpy.float64]]) -> None:
...
class GradientDescentSolverProperties(SolverProperties, GradientDescentSolverUniqueProperties):
@typing.overload
def __init__(self) -> None:
...
@typing.overload
def __init__(self, solverProperties: SolverProperties) -> None:
...
@typing.overload
def __init__(self, solverProperties: SolverProperties, descentProperties: GradientDescentSolverUniqueProperties) -> None:
...
class GradientDescentSolver(Solver):
Type: typing.ClassVar[str] = 'GradientDescentSolver'
@typing.overload
def __init__(self) -> None:
...
@typing.overload
def __init__(self, properties: GradientDescentSolverProperties) -> None:
...
@typing.overload
def __init__(self, problem: ...) -> None:
...
def clampToBoundary(self, x: numpy.ndarray[tuple[M, typing.Literal[1]], numpy.dtype[numpy.float64]]) -> None:
...
def clone(self) -> Solver:
...
def getDefaultConstraintWeight(self) -> float:
...
def getGradientDescentProperties(self) -> GradientDescentSolverProperties:
...
def getLastConfiguration(self) -> numpy.ndarray[tuple[M, typing.Literal[1]], numpy.dtype[numpy.float64]]:
...
def getLastNumIterations(self) -> int:
...
def getMaxAttempts(self) -> int:
...
def getMaxPerturbationFactor(self) -> float:
...
def getPerturbationStep(self) -> int:
...
def getStepSize(self) -> float:
...
def getType(self) -> str:
...
def randomizeConfiguration(self, x: numpy.ndarray[tuple[M, typing.Literal[1]], numpy.dtype[numpy.float64]]) -> None:
...
def setDefaultConstraintWeight(self, newDefault: float) -> None:
...
def setMaxAttempts(self, maxAttempts: int) -> None:
...
def setMaxPerturbationFactor(self, factor: float) -> None:
...
def setPerturbationStep(self, step: int) -> None:
...
@typing.overload
def setProperties(self, properties: GradientDescentSolverProperties) -> None:
...
@typing.overload
def setProperties(self, properties: GradientDescentSolverUniqueProperties) -> None:
...
def setStepSize(self, newMultiplier: float) -> None:
...
def solve(self) -> bool:
...