Trait renforce::util::QFunction
[−]
[src]
pub trait QFunction<S: Space, A: Space>: Debug { fn eval(&self, state: &S::Element, action: &A::Element) -> f64; fn update(&mut self,
state: &S::Element,
action: &A::Element,
new_val: f64,
alpha: f64); }
QFunction Trait
Represents a function Q: S x A -> R that takes in a (state, action) pair and returns the value of that pair
Required Methods
fn eval(&self, state: &S::Element, action: &A::Element) -> f64
Evaluate the function on the given state and action
fn update(&mut self,
state: &S::Element,
action: &A::Element,
new_val: f64,
alpha: f64)
state: &S::Element,
action: &A::Element,
new_val: f64,
alpha: f64)
Update the function using the given information (alpha is learning rate)
Implementors
impl<S: Space, A: FiniteSpace, Q: QFunction<S, A>> QFunction<S, A> for GreedyQAgent<S, A, Q>
impl<S: Space, A: FiniteSpace, Q, T> QFunction<S, A> for EGreedyQAgent<S, A, Q, T> where T: Chooser<A::Element>,
Q: QFunction<S, A>impl<S: FiniteSpace, A: FiniteSpace> QFunction<S, A> for QTable<S, A> where S::Element: Hash + Eq,
A::Element: Hash + Eqimpl<F: Float + Debug, S: Space, A: FiniteSpace> QFunction<S, A> for QLinear<F, S, A> where A::Element: Hash + Eq