Skip to content

Commit

Permalink
first version of the show method (print when instantiate a Stopping)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmigot committed Dec 21, 2020
1 parent 9869125 commit 88712c0
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Stopping.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,24 @@ include("Stopping/StoppingMetamod.jl")

export AbstractStoppingMeta, StoppingMeta

import Base.show
function show(io :: IO, stp :: AbstractStopping)
println(io, typeof(stp))
println(io, "with the current state $(typeof(stp.current_state)) and metadata $(typeof(stp.meta)).")
if stp.main_stp != nothing
println(io, "it has a main_stp $(typeof(stp.main_stp))")
end
if stp.listofstates != nothing
nmax = stp.listofstates.n == -1 ? Inf : stp.listofstates.n
println(io, "it handles a list of states $(typeof(stp.listofstates)) of maximum length $(nmax)")
end
try
print("Problem is ")
show(io, stp.pb)
catch
end
end

# Stopping
include("Stopping/GenericStoppingmod.jl")
include("Stopping/LineSearchStoppingmod.jl")
Expand Down

0 comments on commit 88712c0

Please sign in to comment.