pub struct Schedule<T>(/* private fields */);Expand description
Includes all configurations from time $1$ to time $t_end$.
Implementations§
Source§impl<'a, T> Schedule<T>where
T: Value<'a>,
impl<'a, T> Schedule<T>where
T: Value<'a>,
Sourcepub fn new(x: Vec<Config<T>>) -> Schedule<T>
pub fn new(x: Vec<Config<T>>) -> Schedule<T>
Converts a vector of configurations to a schedule.
pub fn repeat(x: Config<T>, t: i32) -> Schedule<T>
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true if the schedule is empty (i.e. does not include any config).
Sourcepub fn now_with_default(&self, default: Config<T>) -> Config<T>
pub fn now_with_default(&self, default: Config<T>) -> Config<T>
Returns the config of the latest time step.
Sourcepub fn extend(&self, x: Config<T>) -> Schedule<T>
pub fn extend(&self, x: Config<T>) -> Schedule<T>
Immutably Extends schedule with a new final config.
Sourcepub fn from_raw(d: i32, w: i32, raw_xs: &[T]) -> Schedule<T>
pub fn from_raw(d: i32, w: i32, raw_xs: &[T]) -> Schedule<T>
Builds a schedule from a raw (flat) encoding $raw_xs$ (used for convex optimization). $d$ is the number of dimensions, $w$ is the length of the time window. The length of $raw_xs$ must therefore be $d \cdot w$.
Sourcepub fn build_raw(w: i32, x: &Config<T>) -> Vec<T>
pub fn build_raw(w: i32, x: &Config<T>) -> Vec<T>
Builds a raw (flat) encoding of a schedule (used for convex optimization) by stretching a config across the time window $w$.
Sourcepub fn raw_encoding_len(d: i32, w: i32) -> i32
pub fn raw_encoding_len(d: i32, w: i32) -> i32
Returns the length of the raw encoding of $d$ dimensions across time window $w$.
Trait Implementations§
Source§impl<'a, T, U> CastableSchedule<T> for Schedule<U>where
T: Value<'a>,
U: Value<'a>,
impl<'a, T, U> CastableSchedule<T> for Schedule<U>where
T: Value<'a>,
U: Value<'a>,
Source§impl<'de, T> Deserialize<'de> for Schedule<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Schedule<T>where
T: Deserialize<'de>,
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<'a, T> DiscretizableSchedule for Schedule<T>where
T: Value<'a>,
impl<'a, T> DiscretizableSchedule for Schedule<T>where
T: Value<'a>,
Source§fn to_i(&self) -> IntegralSchedule
fn to_i(&self) -> IntegralSchedule
Discretize a schedule.
Source§impl<'a, T> FromIterator<Config<T>> for Schedule<T>where
T: Value<'a>,
impl<'a, T> FromIterator<Config<T>> for Schedule<T>where
T: Value<'a>,
Source§impl<'a, T> FromParallelIterator<Config<T>> for Schedule<T>where
T: Value<'a>,
impl<'a, T> FromParallelIterator<Config<T>> for Schedule<T>where
T: Value<'a>,
Source§fn from_par_iter<I>(iter: I) -> Selfwhere
I: IntoParallelIterator<Item = Config<T>>,
fn from_par_iter<I>(iter: I) -> Selfwhere
I: IntoParallelIterator<Item = Config<T>>,
Creates an instance of the collection from the parallel iterator
par_iter. Read moreSource§impl<'a, 'b, T> IntoParallelIterator for &'a Schedule<T>where
T: Value<'b>,
impl<'a, 'b, T> IntoParallelIterator for &'a Schedule<T>where
T: Value<'b>,
Source§impl<'a, T> IntoParallelIterator for Schedule<T>where
T: Value<'a>,
impl<'a, T> IntoParallelIterator for Schedule<T>where
T: Value<'a>,
Source§impl<'a, T> Resettable<'a> for Schedule<T>where
T: Value<'a>,
impl<'a, T> Resettable<'a> for Schedule<T>where
T: Value<'a>,
Source§impl<'a, T> VecWrapper for Schedule<T>where
T: Value<'a>,
impl<'a, T> VecWrapper for Schedule<T>where
T: Value<'a>,
impl<T: Eq> Eq for Schedule<T>
impl<T> StructuralPartialEq for Schedule<T>
Auto Trait Implementations§
impl<T> Freeze for Schedule<T>
impl<T> RefUnwindSafe for Schedule<T>where
T: RefUnwindSafe,
impl<T> Send for Schedule<T>where
T: Send,
impl<T> Sync for Schedule<T>where
T: Sync,
impl<T> Unpin for Schedule<T>where
T: Unpin,
impl<T> UnwindSafe for Schedule<T>where
T: UnwindSafe,
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> 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 moreSource§impl<'data, I> IntoParallelRefIterator<'data> for I
impl<'data, I> IntoParallelRefIterator<'data> for I
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.