|
449 | 449 | """ |
450 | 450 | $(TYPEDSIGNATURES) |
451 | 451 |
|
| 452 | +Get the initial time from the model, for a free initial time. |
| 453 | +""" |
| 454 | +function initial_time( |
| 455 | + ocp::Model{ |
| 456 | + <:TimesModel{FreeTimeModel,<:AbstractTimeModel}, |
| 457 | + <:AbstractStateModel, |
| 458 | + <:AbstractControlModel, |
| 459 | + <:AbstractVariableModel, |
| 460 | + <:Function, |
| 461 | + <:AbstractObjectiveModel, |
| 462 | + <:AbstractConstraintsModel, |
| 463 | + }, |
| 464 | + variable::T, |
| 465 | +)::T where {T<:ctNumber} |
| 466 | + return initial_time(times(ocp), [variable]) |
| 467 | +end |
| 468 | + |
| 469 | +""" |
| 470 | +$(TYPEDSIGNATURES) |
| 471 | +
|
452 | 472 | Get the name of the initial time from the model. |
453 | 473 | """ |
454 | 474 | function initial_time_name(ocp::Model)::String |
|
532 | 552 | """ |
533 | 553 | $(TYPEDSIGNATURES) |
534 | 554 |
|
| 555 | +Get the final time from the model, for a free final time. |
| 556 | +""" |
| 557 | +function final_time( |
| 558 | + ocp::Model{ |
| 559 | + <:TimesModel{<:AbstractTimeModel,FreeTimeModel}, |
| 560 | + <:AbstractStateModel, |
| 561 | + <:AbstractControlModel, |
| 562 | + <:AbstractVariableModel, |
| 563 | + <:Function, |
| 564 | + <:AbstractObjectiveModel, |
| 565 | + <:AbstractConstraintsModel, |
| 566 | + }, |
| 567 | + variable::T, |
| 568 | +)::T where {T<:ctNumber} |
| 569 | + return final_time(times(ocp), [variable]) |
| 570 | +end |
| 571 | + |
| 572 | +""" |
| 573 | +$(TYPEDSIGNATURES) |
| 574 | +
|
535 | 575 | Get the name of the final time from the model. |
536 | 576 | """ |
537 | 577 | function final_time_name(ocp::Model)::String |
|
0 commit comments