public class SimpleRLearn
extends java.lang.Object
Constructor and Description |
---|
SimpleRLearn(int Ns,
int Na)
Default Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addAction()
Add action.
|
void |
addState()
Add state.
|
int |
getBestAction(int s)
Gets the best action for state s.
|
int |
getNa()
Gets NA value.
|
int |
getNs()
Gets NS value.
|
double[][] |
getQ()
Gets Q value.
|
boolean |
isEmpty()
Verify if is empty.
|
void |
printQ()
Print Q value.
|
void |
setNa(int na)
Sets NA value.
|
void |
setNs(int ns)
Gets NS value.
|
void |
setQ(double[][] q)
Sets Q value.
|
void |
update(int s,
int a,
double r)
Updates Q table of values.
|
public SimpleRLearn(int Ns, int Na)
Ns
- Na
- public void update(int s, int a, double r)
s
- current statea
- chosen actionr
- reward for performing action a in state s, should be between -1 and 1public void addAction()
public void addState()
public void printQ()
public int getBestAction(int s)
s
- input statepublic double[][] getQ()
public void setQ(double[][] q)
q
- the q to setpublic int getNa()
public void setNa(int na)
na
- the na to setpublic int getNs()
public void setNs(int ns)
ns
- the ns to setpublic boolean isEmpty()