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

fix for dependency issue

parent 6771053e
......@@ -33,8 +33,7 @@ obj = "M1"
f_name = Symbol("cost_" * obj)
println("Loading data...")
obj_add = add * obj
contours = clean_contour.(contour.(JSON.parse(open(obj_add * "contours.json"))))
contours = [c for c in contours if c!=nothing]
contours = clean_contours(contour.(JSON.parse(open(obj_add * "contours.json"))))
cdata = contourdata(contours, 20, 5) # contour data
@time vd = voxdata(obj_add * "_voxels.csv", cdata)
stress_multiplier!(vd.voxels,10)
......@@ -96,7 +95,7 @@ plot(rl_g, cdata)
plot(rl_l, cdata)
# plot rollout animated
@time plot_animate(rl_l, cdata, rate=1)
@time plot_animate(rl_g, cdata, rate=1)
# plot results
plot(results)
......
......@@ -664,6 +664,37 @@ function clean_contour(c::contour)
end
function clean_contours(cons::Vector{contour})
cons = clean_contour.(cons)
cons = [c for c in cons if c!=nothing]
new_contours = contour[]
for c in cons
if c.pos[1,3] == c.pos[end,3]
push!(new_contours, c)
else
i = 1
j = 2
c_len = size(c.pos)[1]
while j <= c_len + 1
if j<=c_len && c.pos[j,3] == c.pos[i,3]
j += 1
else
push!(new_contours, contour(c.pos[i:j-1,:], c.time[i:j-1]))
i = j
j += 1
end
end
end
end
new_c2 = contour[]
for c in new_contours
if size(c.pos)[1] >1
push!(new_c2, c)
end
end
return new_c2
end
function stress_multiplier!(a::DataFrame, mul::Number)
a.Sx = a.Sx*mul
a.Sy = a.Sy*mul
......
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