This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using BangBang | |
using StaticArrays | |
using MuJoCo | |
struct MJDeriv | |
m::jlModel | |
dmain::jlData | |
datas::Vector{jlData} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using SIMD | |
using BenchmarkTools | |
foo(x, s, t) = x[ x .< s] .= t | |
foo2(x, s, t) = for i in eachindex(x) x[i] = x[i] < s ? t : x[i] end | |
foo3(x, s, t) = @inbounds for i in eachindex(x) x[i] = x[i] < s ? t : x[i] end | |
function foo3b(x, s, t) | |
@inbounds for i in eachindex(x) | |
(x[i] < s) && (x[i] = t) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using MuJoCo | |
function dorollout(f, T) | |
pm = mj_loadXML(f) | |
pd = mj_makeData(pm) | |
m = mj.mapmodel(pm) | |
datas = [ mj.mapdata(pm, mj_makeData(pm)) for t=1:Threads.nthreads() ] | |
@time begin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Edit this file to introduce tasks to be run by cron. | |
# | |
# Each task to run has to be defined through a single line | |
# indicating with different fields when the task will be run | |
# and what command to run for the task | |
# | |
# To define the time you can provide concrete values for | |
# minute (m), hour (h), day of month (dom), month (mon), | |
# and day of week (dow) or use '*' in these fields (for 'any').# | |
# Notice that tasks will be started based on the cron's system |