Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jayant Khatkar
tempaware
Commits
e54b574c
Commit
e54b574c
authored
Oct 16, 2021
by
Jayant Khatkar
Browse files
updated greedish rollout approach
parent
a1c93c84
Changes
1
Hide whitespace changes
Inline
Side-by-side
utils.jl
View file @
e54b574c
...
...
@@ -469,7 +469,9 @@ function greedy_rollout(cdata::contourdata)
end
function
greedish_rollout
(
cdata
::
contourdata
)
function
greedish_rollout
(
cdata
::
contourdata
;
α
=
0.5
)
# α=1 is totally greedy
# α=0 is totally random
done_contours
=
Set
{
Int
}()
avail_contours
=
Set
(
cdata
.
layers
[
1
])
todo_contours
=
Set
(
1
:
length
(
cdata
.
contours
))
...
...
@@ -489,8 +491,8 @@ function greedish_rollout(cdata::contourdata)
end
temp_avail_list
=
collect
(
avail_contours
)
w
=
dep_times
[
temp_avail_list
]
w
=
w
.
-
minimum
(
w
)
*
0.9
c
=
sample
(
temp_avail_list
,
Weights
(
w
)
)
top_choices
=
w
.>=
minimum
(
w
)
+
α
*
(
maximum
(
w
)
-
minimum
(
w
)
)
c
=
rand
(
temp_avail_list
[
top_choices
]
)
push!
(
rollout
,
c
)
contour_order
[
c
]
=
length
(
rollout
)
...
...
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