pub struct Schedule<T>(_);
Expand description
Includes all configurations from time $1$ to time $t_end$.
Implementations
sourceimpl<'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
sourceimpl<'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>,
sourceimpl<'de, T> Deserialize<'de> for Schedule<T> where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Schedule<T> where
T: Deserialize<'de>,
sourcefn 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
sourceimpl<'a, T> DiscretizableSchedule for Schedule<T> where
T: Value<'a>,
impl<'a, T> DiscretizableSchedule for Schedule<T> where
T: Value<'a>,
sourcefn to_i(&self) -> IntegralSchedule
fn to_i(&self) -> IntegralSchedule
Discretize a schedule.
sourceimpl<'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>,
sourcefn from_iter<I>(iter: I) -> Self where
I: IntoIterator<Item = Config<T>>,
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator<Item = Config<T>>,
Creates a value from an iterator. Read more
sourceimpl<'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>,
sourcefn from_par_iter<I>(iter: I) -> Self where
I: IntoParallelIterator<Item = Config<T>>,
fn from_par_iter<I>(iter: I) -> Self where
I: IntoParallelIterator<Item = Config<T>>,
Creates an instance of the collection from the parallel iterator par_iter
. Read more
sourceimpl<'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>,
sourceimpl<'a, T> IntoParallelIterator for Schedule<T> where
T: Value<'a>,
impl<'a, T> IntoParallelIterator for Schedule<T> where
T: Value<'a>,
sourceimpl<'a, T> Resettable<'a> for Schedule<T> where
T: Value<'a>,
impl<'a, T> Resettable<'a> for Schedule<T> where
T: Value<'a>,
sourceimpl<'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> StructuralEq for Schedule<T>
impl<T> StructuralPartialEq for Schedule<T>
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<'data, I> IntoParallelRefIterator<'data> for I where
I: 'data + ?Sized,
&'data I: IntoParallelIterator,
impl<'data, I> IntoParallelRefIterator<'data> for I where
I: 'data + ?Sized,
&'data I: IntoParallelIterator,
type Iter = <&'data I as IntoParallelIterator>::Iter
type Iter = <&'data I as IntoParallelIterator>::Iter
The type of the parallel iterator that will be returned.
type Item = <&'data I as IntoParallelIterator>::Item
type Item = <&'data I as IntoParallelIterator>::Item
The type of item that the parallel iterator will produce.
This will typically be an &'data T
reference type. Read more
sourcefn par_iter(&'data self) -> <I as IntoParallelRefIterator<'data>>::Iter
fn par_iter(&'data self) -> <I as IntoParallelRefIterator<'data>>::Iter
Converts self
into a parallel iterator. Read more
impl<T> Pointable for T
impl<T> Pointable for T
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
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 more
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).
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.
fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
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 more
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).
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.
fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more