Commit a1c93c84 authored by Jayant Khatkar's avatar Jayant Khatkar
Browse files

greedily weighted random rollout

parent 74e410b1
...@@ -4,6 +4,7 @@ using JSON ...@@ -4,6 +4,7 @@ using JSON
using LightGraphs using LightGraphs
using NearestNeighbors using NearestNeighbors
using Statistics using Statistics
using StatsBase
using BenchmarkTools using BenchmarkTools
using LinearAlgebra using LinearAlgebra
using PlotlyJS using PlotlyJS
...@@ -487,8 +488,9 @@ function greedish_rollout(cdata::contourdata) ...@@ -487,8 +488,9 @@ function greedish_rollout(cdata::contourdata)
dep_times[c] = mean(contour_order[deps]) dep_times[c] = mean(contour_order[deps])
end end
temp_avail_list = collect(avail_contours) temp_avail_list = collect(avail_contours)
_,i = findmax(dep_times[temp_avail_list]) w = dep_times[temp_avail_list]
c = temp_avail_list[i] # contour with deps printed most recently w = w .- minimum(w)*0.9
c = sample(temp_avail_list, Weights(w))
push!(rollout, c) push!(rollout, c)
contour_order[c] = length(rollout) contour_order[c] = length(rollout)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment