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
6 changes: 4 additions & 2 deletions src/op_scenarios/tree_periods.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ StrategicIndexable(::Type{<:StratNodeOpScenario}) = HasStratIndex()
function Base.show(io::IO, osc::StratNodeOpScenario)
return print(io, "sp$(_strat_per(osc))-br$(_branch(osc))-sc$(_opscen(osc))")
end
Base.eltype(_::StratNodeOpScenario{T,OP}) where {T,OP} = TreePeriod{eltype(op)}
Base.eltype(_::StratNodeOpScenario{T,OP}) where {T,OP} = TreePeriod{eltype(OP)}

"""
struct StratNodeOpScens{T,OP<:TimeStructInnerIter{T}} <: AbstractTreeStructure{T}
Expand Down Expand Up @@ -153,7 +153,9 @@ function Base.show(io::IO, osc::StratNodeReprOpScenario)
"sp$(_strat_per(osc))-br$(_branch(osc))-rp$(_rper(osc))-sc$(_opscen(osc))",
)
end
Base.eltype(_::StratNodeReprOpScenario{T,OP}) where {T,OP} = TreePeriod{eltype(op)}
function Base.eltype(_::StratNodeReprOpScenario{T,OP}) where {T,OP}
return TreePeriod{ReprPeriod{eltype(OP)}}
end

"""
struct StratNodeReprOpScens{T,OP<:TimeStructInnerIter{T}} <: AbstractTreeStructure{T}
Expand Down
3 changes: 2 additions & 1 deletion src/representative/strat_periods.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ function Base.iterate(rpers::StratReprPers, state = (nothing, 1))
return StratReprPeriod(rpers, state[2], next[1]), (next[2], state[2] + 1)
end
function Base.getindex(rpers::StratReprPers, index::Int)
return StratReprPeriod(rpers, index)
per = _oper_struct(rpers)[index]
return StratReprPeriod(rpers, index, per)
end
function Base.eachindex(rpers::StratReprPers)
return eachindex(_oper_struct(rpers))
Expand Down
2 changes: 1 addition & 1 deletion src/representative/tree_periods.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ end
function Base.show(io::IO, rp::StratNodeReprPeriod)
return print(io, "sp$(_strat_per(rp))-br$(_branch(rp))-rp$(_rper(rp))")
end
Base.eltype(_::StratNodeReprPeriod{T,OP}) where {T,OP} = TreePeriod{eltype(op)}
Base.eltype(_::StratNodeReprPeriod{T,OP}) where {T,OP} = TreePeriod{eltype(OP)}

"""
struct StratNodeReprPers{T,OP<:TimeStructInnerIter{T}} <: AbstractTreeStructure{T}
Expand Down
Loading