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
#[no_mangle] | |
pub unsafe extern fn mr_MatrixIsZero( | |
mut m : *const f64, n1 : i32, n2 : i32 | |
) -> i32 { | |
let mut _currentBlock; | |
let mut i : i32; | |
let mut n : i32 = n1 * n2; | |
i = 0i32; | |
'loop1: loop { | |
if !(i < n) { |
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
struct _mjModel | |
{ | |
// ------------------------------- sizes | |
// sizes needed at mjModel construction | |
int nq; // number of generalized coordinates = dim(qpos) | |
int nv; // number of degrees of freedom = dim(qvel) | |
int nu; // number of actuators/controls = dim(ctrl) | |
int na; // number of activation states = dim(act) | |
int nbody; // number of bodies |
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
let gaussian |
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
# examples/mountain_car.jl | |
# Import the RL algorithms | |
using Reinforce | |
# Import the Mountain car environment | |
using Reinforce.MountainCarEnv: MountainCar | |
# Import the Plots plotting library and use GR as the backend | |
# https://github.com/jheinen/GR.jl |
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
# examples/mountain_car.jl | |
# Import the RL algorithms | |
using Reinforce | |
# Import the Mountain car environment | |
using Reinforce.MountainCarEnv: MountainCar | |
# Import the Plots plotting library and use GR as the backend | |
# https://github.com/jheinen/GR.jl |
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
cd github.com |
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
git clone https://github.com/JuliaML/Reinforce.jl | |
cd Reinforce.jl |
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
# Full example here https://github.com/JuliaOpt/JuMP.jl/blob/master/examples/cannery.jl | |
@variable(cannery, ship[1:num_plants, 1:num_markets] >= 0) | |
# Ship no more than plant capacity | |
@constraint(cannery, capacity_con[i in 1:num_plants], | |
sum(ship[i,j] for j in 1:num_markets) <= capacity[i] | |
) | |
# Ship at least market demand |
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
struct Point{T} | |
x::T | |
y::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
# https://github.com/JuliaML/Reinforce.jl/blob/master/examples/mountain_car.jl | |
using Reinforce | |
using Reinforce.MountainCarEnv: MountainCar | |
using Plots | |
gr() | |
# Deterministic policy that is solving the problem | |
mutable struct BasicCarPolicy <: Reinforce.AbstractPolicy end |