-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Can support for addition and subtraction for TimeProfile's be added?
One could implement this by
+(a::FixedProfile{T}, b::FixedProfile{T}) where {T} = FixedProfile(a.val + b.val)
function +(a::OperationalProfile{T}, b::OperationalProfile{T}) where {T}
return OperationalProfile(a.vals .+ b.vals)
end
function +(a::StrategicProfile{T}, b::StrategicProfile{T}) where {T}
return StrategicProfile(a.vals .+ b.vals)
end
function +(a::ScenarioProfile{T}, b::ScenarioProfile{T}) where {T}
return ScenarioProfile(a.vals .+ b.vals)
end
function +(a::RepresentativeProfile{T}, b::RepresentativeProfile{T}) where {T}
return RepresentativeProfile(a.vals .+ b.vals)
end
-(a::TimeProfile{T}, b::TimeProfile{T}) where {T} = a + (-b)or one could implement length(::TimeProfile) and iterate(::TimeProfile) with the .+ and .- convention.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels