Skip to content

Commit

Permalink
add get_name for function for algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
m-fila committed Aug 29, 2024
1 parent ddb0ab5 commit deb2905
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/scheduling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ function (alg::AbstractAlgorithm)(args...; event_number::Int,
error("Subtypes of AbstractAlgorithm must implement function call")
end

function get_name(alg::AbstractAlgorithm)
error("Subtypes of AbstractAlgorithm must implement get_name")
end

struct MockupAlgorithm <: AbstractAlgorithm
name::String
runtime::Float64
Expand Down Expand Up @@ -40,6 +44,10 @@ function (alg::MockupAlgorithm)(args...; event_number::Int,
return alg.name
end

function get_name(alg::MockupAlgorithm)
return alg.name
end

struct BoundAlgorithm
alg::AbstractAlgorithm
event_number::Int
Expand All @@ -50,6 +58,10 @@ function (algorithm::BoundAlgorithm)(data...; coefficients::Union{Vector{Float64
coefficients = coefficients)
end

function get_name(alg::BoundAlgorithm)
return get_name(alg.alg)
end

struct DataFlowGraph
graph::MetaDiGraph
algorithm_indices::Vector{Int}
Expand Down

0 comments on commit deb2905

Please sign in to comment.