Struct renforce::agent::qagents::EGreedyQAgent
[−]
[src]
pub struct EGreedyQAgent<S: Space, A: FiniteSpace, Q: QFunction<S, A>, T: Chooser<A::Element>> { /* fields omitted */ }
Epsilon Greedy Q-Agent
Represents an agent that acts randomly with probabilty epsilon and acts greedily with probabilty (1 - epsilon)
Methods
impl<S: Space, A: FiniteSpace, Q, T> EGreedyQAgent<S, A, Q, T> where T: Chooser<A::Element>,
Q: QFunction<S, A>
[src]
Q: QFunction<S, A>
fn new(q_func: Q,
action_space: A,
epsilon: f64,
chooser: T)
-> EGreedyQAgent<S, A, Q, T>
action_space: A,
epsilon: f64,
chooser: T)
-> EGreedyQAgent<S, A, Q, T>
Returns a new EGreedyQAgent with the given information
fn set_epsilon(&mut self, ep: f64)
Sets new value for epsilon
fn to_greedy(self) -> GreedyQAgent<S, A, Q>
Returns a GreedyQAgent using this agent's q_function
Trait Implementations
impl<S: Debug + Space, A: Debug + FiniteSpace, Q: Debug + QFunction<S, A>, T: Debug + Chooser<A::Element>> Debug for EGreedyQAgent<S, A, Q, T>
[src]
impl<S: Space, A: FiniteSpace, Q, T> Agent<S, A> for EGreedyQAgent<S, A, Q, T> where T: Chooser<A::Element>,
Q: QFunction<S, A>
[src]
Q: QFunction<S, A>
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, T> QFunction<S, A> for EGreedyQAgent<S, A, Q, T> where T: Chooser<A::Element>,
Q: QFunction<S, A>
[src]
Q: QFunction<S, A>
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, T> ParameterizedFunc<N> for EGreedyQAgent<S, A, Q, T> where T: Chooser<A::Element>,
Q: QFunction<S, A> + ParameterizedFunc<N>
[src]
Q: QFunction<S, A> + ParameterizedFunc<N>
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, S: Space, A: FiniteSpace, Q, T> FeatureExtractor<S, A, F> for EGreedyQAgent<S, A, Q, T> where T: Chooser<A::Element>,
Q: QFunction<S, A> + FeatureExtractor<S, A, F>
[src]
Q: QFunction<S, A> + FeatureExtractor<S, A, F>
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
impl<F: Float, S: Space, A: FiniteSpace, Q, T> DifferentiableFunc<S, A, F> for EGreedyQAgent<S, A, Q, T> where T: Chooser<A::Element>,
Q: QFunction<S, A> + DifferentiableFunc<S, A, F>
[src]
Q: QFunction<S, A> + DifferentiableFunc<S, A, F>