pub struct Chain {
pub size: usize,
pub discount_factor: f64,
}
Expand description
Chain Environment
Consists of n states in a line with 2 actions.
- Action 0 moves back to the start for 2 reward.
- Action 1 moves forward for 0 reward in all states but the last. In the last state, taking action 1 is a self-transition with 10 reward.
- Every action has a 0.2 chance of “slipping” and taking the opposite action.
Described in “Bayesian Q-learning” by Dearden, Friedman and Russel (1998)
Fields§
§size: usize
§discount_factor: f64
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Chain
impl<'de> Deserialize<'de> for Chain
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl EnvStructure for Chain
impl EnvStructure for Chain
type ObservationSpace = IndexSpace
type ActionSpace = IndexedTypeSpace<Move>
type FeedbackSpace = IntervalSpace<Reward>
Source§fn observation_space(&self) -> Self::ObservationSpace
fn observation_space(&self) -> Self::ObservationSpace
Space containing all possible observations. Read more
Source§fn action_space(&self) -> Self::ActionSpace
fn action_space(&self) -> Self::ActionSpace
The space of all possible actions. Read more
Source§fn feedback_space(&self) -> Self::FeedbackSpace
fn feedback_space(&self) -> Self::FeedbackSpace
The space of all possible feedback. Read more
Source§fn discount_factor(&self) -> f64
fn discount_factor(&self) -> f64
A discount factor applied to future feedback. Read more
Source§impl Environment for Chain
impl Environment for Chain
Source§type Observation = usize
type Observation = usize
Observation of the state provided to the agent.
Source§fn initial_state(&self, _: &mut Prng) -> Self::State
fn initial_state(&self, _: &mut Prng) -> Self::State
Sample a state for the start of a new episode. Read more
Source§fn observe(&self, state: &Self::State, _: &mut Prng) -> Self::Observation
fn observe(&self, state: &Self::State, _: &mut Prng) -> Self::Observation
Generate an observation for a given state.
impl CloneBuild for Chain
impl Copy for Chain
impl StructuralPartialEq for Chain
Auto Trait Implementations§
impl Freeze for Chain
impl RefUnwindSafe for Chain
impl Send for Chain
impl Sync for Chain
impl Unpin for Chain
impl UnwindSafe for Chain
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> BuildEnv for T
impl<T> BuildEnv for T
Source§type Observation = <T as Environment>::Observation
type Observation = <T as Environment>::Observation
Environment observation type.
Source§type Action = <T as Environment>::Action
type Action = <T as Environment>::Action
Environment action type.
Source§type Feedback = <T as Environment>::Feedback
type Feedback = <T as Environment>::Feedback
Environment feedback type.
Source§type ObservationSpace = <T as EnvStructure>::ObservationSpace
type ObservationSpace = <T as EnvStructure>::ObservationSpace
Environment observation space type.
Source§type ActionSpace = <T as EnvStructure>::ActionSpace
type ActionSpace = <T as EnvStructure>::ActionSpace
Environment action space type.
Source§type FeedbackSpace = <T as EnvStructure>::FeedbackSpace
type FeedbackSpace = <T as EnvStructure>::FeedbackSpace
Environment feedback space type.
Source§type Environment = T
type Environment = T
Type of environment to build
Source§fn build_env(
&self,
_: &mut ChaCha8Rng,
) -> Result<<T as BuildEnv>::Environment, BuildEnvError>
fn build_env( &self, _: &mut ChaCha8Rng, ) -> Result<<T as BuildEnv>::Environment, BuildEnvError>
Build an environment instance. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more