Anton Reinhard 1b4ba285c3
Some checks failed
MetagraphOptimization_CI / test (push) Failing after 7m59s
MetagraphOptimization_CI / docs (push) Failing after 8m6s
WIP refactor
2024-06-24 23:31:30 +02:00

47 lines
1.5 KiB
Julia

"""
AbstractModel
Base type for all models. From this, [`AbstractProblemInstance`](@ref)s can be constructed.
See also: [`problem_instance`](@ref)
"""
abstract type AbstractModel end
"""
problem_instance(::AbstractModel, ::Vararg)
Interface function that must be implemented for any implementation of [`AbstractModel`](@ref). This function should return a specific [`AbstractProblemInstance`](@ref) given some parameters.
"""
function problem_instance end
"""
AbstractProblemInstance
Base type for problem instances. An object of this type of a corresponding [`AbstractModel`](@ref) should uniquely identify a problem instance of that model.
See also: [`parse_process`](@ref)
"""
abstract type AbstractProblemInstance end
"""
input_type(problem::AbstractProblemInstance)
Return the fully specified input type for a specific [`AbstractProblemInstance`](@ref).
"""
function input_type end
"""
graph(::AbstractProblemInstance)
Generate the [`DAG`](@ref) for the given [`AbstractProblemInstance`](@ref). Every entry node (see [`get_entry_nodes`](@ref)) to the graph must have a name set. Implement [`input_expr`](@ref) to return a valid expression for each of those names.
"""
function graph end
"""
input_expr(::AbstractProblemInstance, input_sym::Symbol, name::String)
For a given [`AbstractProblemInstance`](@ref), a `Symbol` on which the problem input is available (see [`input_type`](@ref)), and entry node name, return an `Expr` getting that specific input value from the
"""
function input_expr end