changed algorithm to make use of recent cubes
This commit is contained in:
@@ -17,7 +17,7 @@ end
|
||||
|
||||
function getPossibleNeighbors(S::Polycube)
|
||||
possibleSpots = Set{Tuple{Int64, Int64, Int64}}()
|
||||
for p ∈ S.cubes
|
||||
for p ∈ S.recentCubes
|
||||
push!(possibleSpots,
|
||||
p + (1, 0, 0),
|
||||
p + (0, 1, 0),
|
||||
|
||||
@@ -27,7 +27,7 @@ function scanForPolycubes(MaxSize::Int64)
|
||||
acceptable_growth = MaxSize - length(cube.cubes)
|
||||
possibleGrowth = powerset(growableSpaces, 1, acceptable_growth)
|
||||
for cubesToAdd ∈ possibleGrowth
|
||||
newPolycube = deepcopy(cube)
|
||||
newPolycube = Polycube(copy(cube.cubes), Set(cubesToAdd), deepcopy(cube.orderedLists))
|
||||
for c ∈ cubesToAdd
|
||||
push!(newPolycube, c)
|
||||
end
|
||||
@@ -57,7 +57,7 @@ function evaluatePolycube(polycube::Polycube, D::Dict{UInt, ImmutableOrientedPol
|
||||
|
||||
possibleGrowth = powerset(growableSpaces, 1, acceptable_growth)
|
||||
for cubesToAdd ∈ possibleGrowth
|
||||
newPolycube = deepcopy(polycube)
|
||||
newPolycube = Polycube(copy(polycube.cubes), Set(cubesToAdd), deepcopy(polycube.orderedLists))
|
||||
for c ∈ cubesToAdd
|
||||
push!(newPolycube, c)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user