2023-08-21 12:54:45 +02:00
|
|
|
# function to return the possible operations of a graph
|
|
|
|
|
|
|
|
using Base.Threads
|
|
|
|
|
2023-08-29 12:57:46 +02:00
|
|
|
"""
|
|
|
|
get_operations(graph::DAG)
|
|
|
|
|
|
|
|
Return the [`PossibleOperations`](@ref) of the graph at the current state.
|
|
|
|
"""
|
2023-08-21 12:54:45 +02:00
|
|
|
function get_operations(graph::DAG)
|
2023-08-25 10:48:22 +02:00
|
|
|
apply_all!(graph)
|
2023-08-21 12:54:45 +02:00
|
|
|
|
2023-08-25 10:48:22 +02:00
|
|
|
if isempty(graph.possibleOperations)
|
2023-08-29 12:57:46 +02:00
|
|
|
generate_operations(graph)
|
2023-08-25 10:48:22 +02:00
|
|
|
end
|
2023-08-21 12:54:45 +02:00
|
|
|
|
2023-11-21 01:48:59 +01:00
|
|
|
clean_node!.(Ref(graph), graph.dirtyNodes)
|
2023-08-25 10:48:22 +02:00
|
|
|
empty!(graph.dirtyNodes)
|
2023-08-21 12:54:45 +02:00
|
|
|
|
2023-08-25 10:48:22 +02:00
|
|
|
return graph.possibleOperations
|
2023-08-21 12:54:45 +02:00
|
|
|
end
|