Skip to content

Unified TimeStructure types and constructor #79

@JulStraus

Description

@JulStraus

Problem statement

In the current version, we have a few inconsistencies with respect to the individual TimeStructure types. This is a bit related to potential constructors, but in my opinion it is also related to the individual structures.

A TwoLevel structure is given by:

struct TwoLevel{S<:Duration,T,OP<:TimeStructure{T}} <: TimeStructure{T}
    len::Int
    duration::Vector{S}
    operational::Vector{OP}
    op_per_strat::Float64
end

which is structurally similar to a RepresentativePeriods type:

struct RepresentativePeriods{S<:Duration,T,OP<:TimeStructure{T}} <: TimeStructure{T}
    len::Int
    duration::S
    period_share::Vector{Float64}
    rep_periods::Vector{OP}
end

but different to an OperationalScenarios type:

struct OperationalScenarios{T,OP<:TimeStructure{T}} <: TimeStructure{T}
    len::Int
    scenarios::Vector{OP}
    probability::Vector{Float64}
end

The key difference is the location of the sub time structure field indicated through Vector{OP}.

Potential solution

I would unify the overall structure so that it is clear what is where. In my opinion, the Vector{OP} field should be last (except for TwoLevel as it makes sense to have op_per_strat as last). This would be similar to the adjustments for all internal types done in #23 and #29.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions