Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/src/manual/implementing.md
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ solution information.
* [`ResultCount`](@ref)
* [`ObjectiveValue`](@ref)
* [`VariablePrimal`](@ref)
* [`SolveTime`](@ref)
* [`SolveTimeSec`](@ref)

!!! info
You only need to implement [`get`](@ref) for solution attributes. Don't
Expand Down
2 changes: 1 addition & 1 deletion docs/src/reference/models.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ ObjectiveValue
DualObjectiveValue
ObjectiveBound
RelativeGap
SolveTime
SolveTimeSec
SimplexIterations
BarrierIterations
NodeCount
Expand Down
4 changes: 2 additions & 2 deletions src/Test/UnitTests/attributes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ unittests["raw_status_string"] = raw_status_string
"""
solve_time(model::MOI.ModelLike, config::TestConfig)

Test that the [`MOI.SolveTime`](@ref) attribute is implemented for `model`.
Test that the [`MOI.SolveTimeSec`](@ref) attribute is implemented for `model`.
"""
function solve_time(model::MOI.ModelLike, config::TestConfig)
MOI.empty!(model)
Expand All @@ -123,7 +123,7 @@ function solve_time(model::MOI.ModelLike, config::TestConfig)
variable_primal = [(x, 0.0)],
)
if config.solve
time = MOI.get(model, MOI.SolveTime())
time = MOI.get(model, MOI.SolveTimeSec())
@test time ≥ 0.0
end
end
Expand Down
2 changes: 1 addition & 1 deletion src/Test/intlinear.jl
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ function int1test(model::MOI.ModelLike, config::TestConfig)
@test MOI.get(model, MOI.ObjectiveBound()) >= 19.4 - atol
# FIXME the following are currently not implemented in MockOptimizer
# @test MOI.get(model, MOI.RelativeGap()) >= 0.0
# @test MOI.get(model, MOI.SolveTime()) >= 0.0
# @test MOI.get(model, MOI.SolveTimeSec()) >= 0.0
# @test MOI.get(model, MOI.SimplexIterations()) >= 0
# @test MOI.get(model, MOI.BarrierIterations()) >= 0
# @test MOI.get(model, MOI.NodeCount()) >= 0
Expand Down
8 changes: 5 additions & 3 deletions src/attributes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -956,11 +956,13 @@ A model attribute for the final relative optimality gap, defined as ``\\frac{|b-
struct RelativeGap <: AbstractModelAttribute end

"""
SolveTime()
SolveTimeSec()

A model attribute for the total elapsed solution time (in seconds) as reported by the optimizer.
"""
struct SolveTime <: AbstractModelAttribute end
struct SolveTimeSec <: AbstractModelAttribute end

@deprecate SolveTime SolveTimeSec

"""
SimplexIterations()
Expand Down Expand Up @@ -1584,7 +1586,7 @@ function is_set_by_optimize(
DualObjectiveValue,
ObjectiveBound,
RelativeGap,
SolveTime,
SolveTimeSec,
SimplexIterations,
BarrierIterations,
NodeCount,
Expand Down
2 changes: 1 addition & 1 deletion test/Test/unit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ end
MOIU.set_mock_optimize!(
mock,
(mock::MOIU.MockOptimizer) -> begin
MOI.set(mock, MOI.SolveTime(), 0.0)
MOI.set(mock, MOI.SolveTimeSec(), 0.0)
MOIU.mock_optimize!(
mock,
MOI.OPTIMAL,
Expand Down