S
- States set.public class ValueFunction<S extends State> extends java.lang.Object implements JMarkovElement
Constructor and Description |
---|
ValueFunction()
Creates a new empty value function.
|
ValueFunction(java.lang.String name)
Creates a new empty value function.
|
ValueFunction(ValueFunction<S> vf)
Creates a value function from another given value function
|
ValueFunction(ValueFunction<S> vf,
java.lang.String name)
Creates a value function from another given value function
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
description()
This method return a complete verbal describtion of this element.
|
double[] |
get()
Gets an array with all the values represented in this value function.
|
double |
get(S s)
Gets the Value associted with this State.
|
java.util.Iterator<java.util.Map.Entry<S,java.lang.Double>> |
iterator()
Return an iterator used to wakl through the Value Function.
|
java.lang.String |
label()
This method returns a short String used in the user interface to describe
this element.
|
void |
print(java.io.PrintWriter pw)
Prints the Value Function.
|
void |
print(java.io.PrintWriter pw,
java.lang.String statesFormat,
java.lang.String valuesFormat)
Prints the Value function with the given state format , and values format
according to the Format String Syntax.
|
void |
set(S s,
double val)
Associates a state and a double value
|
java.lang.String |
toString()
This method returns a short String used in the user interface to describe
this element.
|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
equals
public ValueFunction()
public ValueFunction(ValueFunction<S> vf)
vf
- value functionpublic ValueFunction(java.lang.String name)
name
- The name for thei value functionpublic ValueFunction(ValueFunction<S> vf, java.lang.String name)
vf
- value functionname
- The name for this value function.public void set(S s, double val)
s
- stateval
- valuepublic java.util.Iterator<java.util.Map.Entry<S,java.lang.Double>> iterator()
public double get(S s)
s
- given statepublic double[] get()
public void print(java.io.PrintWriter pw, java.lang.String statesFormat, java.lang.String valuesFormat)
pw
- statesFormat
- format for the states , for example "%-10S" to have 10 width
left aligned states.valuesFormat
- format to use for values. For example us "%6.2" to have 6
width and 2 decimals.Formatter
public void print(java.io.PrintWriter pw)
pw
- public java.lang.String toString()
JMarkovElement
public final String toString() { return label(); }
toString
in interface JMarkovElement
toString
in class java.lang.Object
JMarkovElement.label()
public java.lang.String label()
JMarkovElement
label
in interface JMarkovElement
JMarkovElement.description()
public java.lang.String description()
JMarkovElement
description
in interface JMarkovElement
JMarkovElement.label()