Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jayant Khatkar
tempaware
Commits
a7999e9f
Commit
a7999e9f
authored
Sep 01, 2021
by
Jayant Khatkar
Browse files
valid swaps but dependencies only checked to a depth of 1
parent
076c6ace
Changes
1
Hide whitespace changes
Inline
Side-by-side
main.jl
View file @
a7999e9f
...
...
@@ -323,6 +323,39 @@ function random_rollout(prob::problem)
end
function
valid_swap
(
rollout
::
Vector
{
Int
},
i
::
Int
,
j
::
Int
,
prob
::
problem
)
# would swapping indices i and j in rollout result in another valid rollout?
# NOTE THIS FUNCTION DOESNT WORK
# IT ONLY CHECKS DEPENDENCIES TO A DEPTH OF 1
if
i
>
j
i
,
j
=
j
,
i
elseif
i
==
j
return
true
end
c1
=
rollout
[
i
]
c2
=
rollout
[
j
]
c2_dependson
=
inneighbors
(
prob
.
G
,
c2
)
if
c1
in
c2_dependson
return
false
end
c1_dependents
=
outneighbors
(
prob
.
G
,
c1
)
c_between
=
rollout
[
i
+
1
:
j
-
1
]
# method 2
for
c
in
c_between
if
c
in
c1_dependents
||
c
in
c2_dependson
return
false
end
end
return
true
end
#voxels = DataFrames.DataFrame(CSV.File("tensile-1-1.csv"))
contours
=
contour
.
(
JSON
.
parse
(
open
(
"tensilecontours.json"
)))
dt
=
problem
(
contours
,
5
,
5
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment