24 lines
480 B
Julia
Raw Normal View History

# function to return the possible operations of a graph
using Base.Threads
"""
get_operations(graph::DAG)
Return the [`PossibleOperations`](@ref) of the graph at the current state.
"""
function get_operations(graph::DAG)
2023-08-25 10:48:22 +02:00
apply_all!(graph)
2023-08-25 10:48:22 +02:00
if isempty(graph.possibleOperations)
generate_operations(graph)
2023-08-25 10:48:22 +02:00
end
2023-08-25 10:48:22 +02:00
for node in graph.dirtyNodes
clean_node!(graph, node)
end
empty!(graph.dirtyNodes)
2023-08-25 10:48:22 +02:00
return graph.possibleOperations
end