public class DiscreteSpace extends Object implements ActionSpace<Integer>
A discrete space of action. A discrete space is always isomorphic to a space of integer so we can parametrize directly by Integer. Benefit of using Integers directly is that you can use it as the id of the node assigned to that action in the outpout of a DQN.
| Modifier and Type | Field and Description |
|---|---|
protected org.nd4j.linalg.api.rng.Random |
rnd |
protected int |
size |
| Constructor and Description |
|---|
DiscreteSpace(int size) |
DiscreteSpace(int size,
org.nd4j.linalg.api.rng.Random rnd) |
| Modifier and Type | Method and Description |
|---|---|
Object |
encode(Integer a) |
Integer |
noOp() |
Integer |
randomAction() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetSizepublic DiscreteSpace(int size)
public DiscreteSpace(int size,
org.nd4j.linalg.api.rng.Random rnd)
public Integer randomAction()
randomAction in interface ActionSpace<Integer>public Object encode(Integer a)
encode in interface ActionSpace<Integer>public Integer noOp()
noOp in interface ActionSpace<Integer>Copyright © 2019. All rights reserved.