Struct vrp_core::prelude::Environment
source · pub struct Environment {
pub random: Arc<dyn Random + Send + Sync>,
pub quota: Option<Arc<dyn Quota + Send + Sync>>,
pub parallelism: Parallelism,
pub logger: Arc<dyn Fn(&str) + Send + Sync>,
pub is_experimental: bool,
}
Expand description
Keeps track of environment specific information which influences algorithm behavior.
Fields§
§random: Arc<dyn Random + Send + Sync>
A wrapper on random generator.
quota: Option<Arc<dyn Quota + Send + Sync>>
A global execution quota.
parallelism: Parallelism
Keeps data parallelism settings.
logger: Arc<dyn Fn(&str) + Send + Sync>
An information logger.
is_experimental: bool
A boolean flag which signalizes that experimental behavior is allowed.
Implementations§
source§impl Environment
impl Environment
sourcepub fn new_with_time_quota(max_time: Option<usize>) -> Environment
pub fn new_with_time_quota(max_time: Option<usize>) -> Environment
Creates an instance of Environment
using optional time quota and defaults.
Trait Implementations§
source§impl Clone for Environment
impl Clone for Environment
source§fn clone(&self) -> Environment
fn clone(&self) -> Environment
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Default for Environment
impl Default for Environment
source§fn default() -> Environment
fn default() -> Environment
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for Environment
impl !RefUnwindSafe for Environment
impl Send for Environment
impl Sync for Environment
impl Unpin for Environment
impl !UnwindSafe for Environment
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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