Add GraphProperties and property caching

This commit is contained in:
2023-08-28 13:32:22 +02:00
parent 065236be22
commit 7387fa86b1
18 changed files with 300 additions and 101 deletions

View File

@@ -41,9 +41,9 @@ function gen_plot(filepath)
i = i - 1
end
props = graph_properties(g)
props = get_properties(g)
push!(x, props.data)
push!(y, props.compute_effort)
push!(y, props.computeEffort)
end
println("\rDone.")

View File

@@ -44,9 +44,9 @@ function gen_plot(filepath)
props = graph_properties(g)
props = get_properties(g)
x0 = props.data
y0 = props.compute_effort
y0 = props.computeEffort
x = Vector{Float64}()
y = Vector{Float64}()
@@ -55,9 +55,9 @@ function gen_plot(filepath)
opt = get_operations(g)
for op in opt.nodeFusions
push_operation!(g, op)
props = graph_properties(g)
props = get_properties(g)
push!(x, props.data)
push!(y, props.compute_effort)
push!(y, props.computeEffort)
pop_operation!(g)
push!(
@@ -65,15 +65,15 @@ function gen_plot(filepath)
"NF: (" *
string(props.data) *
", " *
string(props.compute_effort) *
string(props.computeEffort) *
")",
)
end
for op in opt.nodeReductions
push_operation!(g, op)
props = graph_properties(g)
props = get_properties(g)
push!(x, props.data)
push!(y, props.compute_effort)
push!(y, props.computeEffort)
pop_operation!(g)
push!(
@@ -81,15 +81,15 @@ function gen_plot(filepath)
"NR: (" *
string(props.data) *
", " *
string(props.compute_effort) *
string(props.computeEffort) *
")",
)
end
for op in opt.nodeSplits
push_operation!(g, op)
props = graph_properties(g)
props = get_properties(g)
push!(x, props.data)
push!(y, props.compute_effort)
push!(y, props.computeEffort)
pop_operation!(g)
push!(
@@ -97,7 +97,7 @@ function gen_plot(filepath)
"NS: (" *
string(props.data) *
", " *
string(props.compute_effort) *
string(props.computeEffort) *
")",
)
end

View File

@@ -3,7 +3,7 @@ function test_random_walk(g::DAG, n::Int64)
# the purpose here is to do "random" operations and reverse them again and validate that the graph stays the same and doesn't diverge
reset_graph!(g)
properties = graph_properties(g)
properties = get_properties(g)
for i in 1:n
# choose push or pop