
org.deeplearning4j.rl4j.space.Box Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gym-java-client Show documentation
Show all versions of gym-java-client Show documentation
A Java client for Open AI's Reinforcement Learning Gym
package org.deeplearning4j.rl4j.space;
import org.json.JSONArray;
/**
* @author rubenfiszel ([email protected]) on 7/8/16.
*
* A Box observation
*
* @see https://gym.openai.com/envs#box2d
*/
public class Box implements Encodable {
private final double[] array;
public Box(JSONArray arr) {
int lg = arr.length();
this.array = new double[lg];
for (int i = 0; i < lg; i++) {
this.array[i] = arr.getDouble(i);
}
}
public double[] toArray() {
return array;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy