Struct renforce::agent::qagents::GreedyQAgent
[−]
[src]
pub struct GreedyQAgent<S: Space, A: FiniteSpace, Q: QFunction<S, A>> { /* fields omitted */ }
Greedy Q-Agent
Represents an agent that only performs the best action according to its QFunction
Methods
impl<S: Space, A: FiniteSpace, Q: QFunction<S, A>> GreedyQAgent<S, A, Q>
[src]
fn new(q_func: Q, action_space: A) -> GreedyQAgent<S, A, Q>
Returns a new GreedyQAgent with the given function and action space
fn to_egreedy<T: Chooser<A::Element>>(self,
eps: f64,
chooser: T)
-> EGreedyQAgent<S, A, Q, T>
eps: f64,
chooser: T)
-> EGreedyQAgent<S, A, Q, T>
Returns an EGreedyQAgent using this agent's Q function
Trait Implementations
impl<S: Debug + Space, A: Debug + FiniteSpace, Q: Debug + QFunction<S, A>> Debug for GreedyQAgent<S, A, Q>
[src]
impl<S: Space, A: FiniteSpace, Q: QFunction<S, A>> Agent<S, A> for GreedyQAgent<S, A, Q>
[src]
fn get_action(&self, state: &S::Element) -> A::Element
Returns the actions the agent should perform in the given state
impl<S: Space, A: FiniteSpace, Q: QFunction<S, A>> QFunction<S, A> for GreedyQAgent<S, A, Q>
[src]
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)
impl<N: Num, S: Space, A: FiniteSpace, Q> ParameterizedFunc<N> for GreedyQAgent<S, A, Q> where Q: QFunction<S, A> + ParameterizedFunc<N>
[src]
fn num_params(&self) -> usize
Returns number of parameters used by the function
fn get_params(&self) -> Vec<N>
Returns the parameters used by the function
fn set_params(&mut self, params: Vec<N>)
Changes the parameters used by the function
impl<F: Float, A: FiniteSpace, S: Space, Q> FeatureExtractor<S, A, F> for GreedyQAgent<S, A, Q> where Q: QFunction<S, A> + FeatureExtractor<S, A, F>
[src]
fn num_features(&self) -> usize
Number of features that can be calculated
fn extract(&self, state: &S::Element, action: &A::Element) -> Vec<F>
Vector containg the values of all the features for this state