public class ValueFunctionRenderLayer extends java.lang.Object implements RenderLayer
StateValuePainter
StatePolicyPainter
and StaticDomainPainter
to paint the value function. Each state is iterated over and the the respective classes are used to pain its value function.
The visualizer requires a QComputablePlanner to retrieve the value function.Modifier and Type | Field and Description |
---|---|
protected QComputablePlanner |
planner
The QComputable planner to use for finding the value function
|
protected java.util.Collection<State> |
statesToVisualize
The states to visualize
|
protected StateValuePainter |
svp
Painter used to visualize the value function
|
Constructor and Description |
---|
ValueFunctionRenderLayer(java.util.Collection<State> states,
StateValuePainter svp,
QComputablePlanner planner)
Initializes the visualizer.
|
Modifier and Type | Method and Description |
---|---|
java.util.Collection<State> |
getStatesToVisualize()
Returns the states that will be visualized
|
StateValuePainter |
getSvp()
Returns the State-wise value function painter
|
protected double |
getVValue(State s)
Returns the value for a state
|
void |
render(java.awt.Graphics2D g2,
float width,
float height) |
void |
setStatesToVisualize(java.util.Collection<State> stateValuesToVisualize)
Sets the states to visualize
|
void |
setSvp(StateValuePainter svp)
Sets the state-wise value function painter
|
protected java.util.Collection<State> statesToVisualize
protected StateValuePainter svp
protected QComputablePlanner planner
public ValueFunctionRenderLayer(java.util.Collection<State> states, StateValuePainter svp, QComputablePlanner planner)
states
- the states whose value should be rendered.svp
- the value function state visualizer to use.planner
- the planner that can return the value function.public java.util.Collection<State> getStatesToVisualize()
public void setStatesToVisualize(java.util.Collection<State> stateValuesToVisualize)
stateValuesToVisualize
- the state to visualizepublic StateValuePainter getSvp()
public void setSvp(StateValuePainter svp)
svp
- state-wise value function painterpublic void render(java.awt.Graphics2D g2, float width, float height)
render
in interface RenderLayer
protected double getVValue(State s)
s
- the state for which to get the value