#don't write as a module


#=
Benefit Functions:

These represent the benefits that different operators may recieve
=#
abstract type EconomicModel end

#basic linear model
struct LinearModel <: EconomicModel
        β::Float32
        payoff_array::Array{Float32}
        policy_costs::Array{Float32}
end
function (em::LinearModel)(
        state::State
        ,actions::Vector{Float32}
        )
        return em.payoff_array*state.stocks - em.policy_costs*actions
end

#basic CES model
struct CES <: EconomicModel
        β::Float32
        r::Float32 #elasticity of subsititution
        payoff_array::Array{Float32}
        policy_costs::Array{Float32}
        debris_costs::Array{Float32}
end
function (em::CES)(
        state::State
        ,actions::Vector{Float32}
        )

        #issue here with multiplication
        r1 = em.payoff_array .* (state.stocks.^em.r)
        r2 = - em.debris_costs .* (state.debris.^em.r)
        r3 = - em.policy_costs .* (actions.^em.r)
        return (r1 + r2 + r3) .^ (1/em.r)

end

#basic CRRA
struct CRRA <: EconomicModel
        β::Float32
        σ::Float32 #elasticity of subsititution
        payoff_array::Array{Float32}
        policy_costs::Array{Float32}
        debris_costs::Array{Float32}
end
function (em::CRRA)(
        state::State
        ,actions::Vector{Float32}
        )
        #issue here with multiplication
        core = (em.payoff_array*state.stocks - em.debris_costs*state.debris - em.policy_costs*actions).^(1 - em.σ)

        return (core-1)/(1-em.σ)
end

