added debug option

This commit is contained in:
Theon-1
2023-09-25 13:32:59 +02:00
parent 3cc7b5d102
commit be2e3fc320

View File

@@ -12,13 +12,16 @@ function options()
println("plotPolycubes(nCubes::Int64, index::Int64=-1): plots Polycubes of size v[1], or just v[2] from the list") println("plotPolycubes(nCubes::Int64, index::Int64=-1): plots Polycubes of size v[1], or just v[2] from the list")
end end
function scanForPolycubes(MaxSize::Int64) function scanForPolycubes(MaxSize::Int64, debug::Bool=false)
T = deserialize("julia/results.bin")
n = T[1]
if (~debug & MaxSize <= n) return end
D = Dict{UInt, ImmutableOrientedPolycube}() D = Dict{UInt, ImmutableOrientedPolycube}()
singletonCube = getCube() singletonCube = getCube()
immutableCube = getImmutableOrientedPolycube(singletonCube) immutableCube = getImmutableOrientedPolycube(singletonCube)
D[immutableCube.hash] = immutableCube D[immutableCube.hash] = immutableCube
evaluatePolycube(singletonCube, D, MaxSize) evaluatePolycube(singletonCube, D, MaxSize)
serialize("julia/results.bin", sanitize(D, MaxSize)) if (~debug) serialize("julia/results.bin", sanitize(D, MaxSize)) end
end end
function evaluatePolycube(polycube::Polycube, D::Dict{UInt, ImmutableOrientedPolycube}, MaxSize::Int64) function evaluatePolycube(polycube::Polycube, D::Dict{UInt, ImmutableOrientedPolycube}, MaxSize::Int64)