[Metadata] Computed features, reference objective, shared initial guess
维护者通常 1 天内回复
@ocots 已经在做这个了。
开始于 2026年11月4日。
评估
这个 Issue 还没有评估数据。
描述
Agents: read the guide for agents in #310 first (order, difficulty, how to claim an issue, working method). The specification is in this description and in the comments below.
Goal
Separate what is computed about a problem from what is declared in its metadata, add the declared fields the tests, the crons and the benchmarks need, and make the metadata the single source of the initial guess shared by every modeling (#151).
Part of #310, step 5. Depends on #283 (continuous problems, Problem) and #303 (statuses). Used by #304 (comparison rule), #305 (crons), #307 (documentation pages).
Current state
metadata(:p)holds:grid_sizeand:parameters(ext/MetaData/<p>.jl, anOrderedDict); types checked at load time (METADATA_INFOS,METADATA_TYPESinsrc/OptimalControlProblems.jl).- The documentation browser already computes dimensions, cost kind (Mayer / Lagrange / Bolza), fixed or free final time and constraint counts from the
ocp(docs/browser.jl:742-767,collect_problem_data). - Initial guesses are written in each model file: in
ext/OptimalControlModels/mostly constants (xinit = [0.1, 0.1]), one function of time, and one defined on the grid (xinit = [[…] for i in 0:N]), which cannot exist for a continuous problem; JuMP models use constantstart=values.
Computed, never written by hand
A function (e.g. features(:beam)) computes, when an extension is loaded: dimensions, cost kind, fixed or free initial and final times, kinds and counts of constraints (box on state / control / variable, nonlinear path, boundary). From the ocp (OptimalControl modelings), or from the keys stored in the JuMP model for problems available in JuMP only. Move the computation out of docs/browser.jl into it; the documentation (browser, status page) and CTBenchmarks read it.
Declared fields
| Field | Content |
|---|---|
:grid_size, :parameters |
unchanged |
:status, :notes |
see #303 |
:known_failures |
see #305 |
:reference_objective |
see below |
:init |
see below |
:tags |
controlled vocabulary defined in src and checked by the tests (e.g. :hard from CTDirect#580, :analytic, :large_state) |
:references |
bibliographic sources of the problem (literature values of the objective, when known, go here as information) |
:corleone |
name of the matching problem in Corleone's OptimalControlBenchmarks, and whether the formulation is the same (#308) |
:reference_solution |
optional: analytic x(t), u(t), for convergence orders |
Every field is type-checked at load time and by the consistency tests of #304.
:reference_objective
Entries (value, source, grid_size, scheme, …), with a priority order:
- Analytic value, when it exists:
source = :analytic,grid_size = nothing, with the reference where it is derived. - Otherwise, computed by us on a fine grid:
source = :computed, with the configuration used (grid size, scheme, modeler, solver, tolerances) and the package versions. A script (e.g.scripts/reference_objective.jl) computes and writes these entries, so they are never typed by hand; it is rerun when a problem or its parameters change.
The source is always stated, in the metadata and in the documentation. For a problem available in one modeling only, a :computed reference is a regression check (it detects changes), not an independent validation: the status page (#307) shows it as such.
Tolerance: to decide later, from the first cron results (#305). Until then the crons report the relative gap to the reference without failing on it.
:init
The initial guess of every modeling comes from the metadata, no longer from each model file:
- format
(state=…, control=…, variable=…); each component a constant, a vector, or a function oft, never data on a grid; - OptimalControl and OptimalControlScalarized: passed as is (
Problem.init, #283); - JuMP: evaluated at the nodes, with the number of controls of the scheme (
N+1for trapezoid,Nfor Euler and midpoint, see #284); - overridable:
beam(JuMPBackend(); init=…), andinit=insolveon the OptimalControl side; - rewrite the grid-defined guess as a function of
t, and check the problem still converges; - the tests check that the OptimalControl guess and the JuMP start values coincide at the nodes (today
test_init).
Not now
:expected_structure (smooth, bang-bang, singular, state constraints) is dropped: it depends on the parameters, and doing it properly means a list of arcs and switching times. To revisit with indirect methods.
Done when
-
features(:p)computed from the model;docs/browser.jluses it. - Declared fields above with type checks; consistency tests cover them.
-
:reference_objectivefor every problem: analytic where it exists, otherwise computed by the script, source stated. - Initial guesses read from the metadata by every modeling; no initial guess left in the model files; the grid-defined one rewritten.
- Initial guess documented (#151), with how to override it.
- 主要语言
- Julia
- 星标
- 13
- 派生
- 1
- 平均合并
- 3 小时 20 分钟
- 30 天内合并 PR
- 27
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
control-toolbox/OptimalControlProblems.jl 的其他 Issue
-
[Metadata] Declared fields: tags, references, Corleone, reference solution可能已有人在做 @ocots 今天认领。 未关闭
control-toolbox/OptimalControlProblems.jl#379 · 已指派 1 人 ·
维护者通常 1 天内回复
-
[Cron] Robustness of the initial guess and known local objectives可能已有人在做 @ocots 今天认领。 未关闭
control-toolbox/OptimalControlProblems.jl#378 · 已指派 1 人 ·
维护者通常 1 天内回复
-
[Metadata] Shared initial guess in the metadata, read by every modeling可能已有人在做 @ocots 今天认领。 未关闭
control-toolbox/OptimalControlProblems.jl#377 · 已指派 1 人 ·
维护者通常 1 天内回复
-
[Metadata] Compute the features of a problem from its model可能已有人在做 @ocots 今天认领。 未关闭
control-toolbox/OptimalControlProblems.jl#376 · 已指派 1 人 ·
维护者通常 1 天内回复
-
[Metadata] Reference objectives per scheme, computed by a script可能已有人在做 @ocots 今天认领。 未关闭
control-toolbox/OptimalControlProblems.jl#375 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 control-toolbox/OptimalControlProblems.jl 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
-
backport 1.14 GC
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复
-
`binary_focal_loss` throws a `DomainError` when a negative sample has `ŷ = 1`可能已有人在做 @parth-patel010 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
JuliaDiff/TaylorSeries.jl#445 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
control-toolbox/CTActions#139 · 1 条评论 ·
维护者通常 1 天内回复