Struct World2d

Source
pub struct World2d { /* private fields */ }

Implementations§

Source§

impl World2d

Source

pub fn new( config: &World2dConfig, simulation: Box<dyn World2dSimulation>, ) -> Self

Source

pub fn generate<FA, FT, FH, FSW>( size: usize, simulation: Box<dyn World2dSimulation>, altitude_generator: FA, temperature_generator: FT, humidity_generator: FH, surface_water_generator: FSW, ) -> Self
where FA: FnMut(usize, usize) -> Scalar, FT: FnMut(usize, usize) -> Scalar, FH: FnMut(usize, usize) -> Scalar, FSW: FnMut(usize, usize) -> Scalar,

Source

pub fn stats(&self) -> &World2dStats

Source

pub fn size(&self) -> usize

Source

pub fn altitude(&self) -> &Grid2d<Scalar>

Source

pub fn temperature(&self) -> &Grid2d<Scalar>

Source

pub fn humidity(&self) -> &Grid2d<Scalar>

Source

pub fn surface_water(&self) -> &Grid2d<Scalar>

Source

pub fn simulation(&self) -> &dyn World2dSimulation

Source

pub fn as_simulation<T>(&self) -> Option<&T>

Source

pub fn process(&mut self)

Source

pub fn remap_region<F, T>( &self, range: Range<(usize, usize)>, f: F, ) -> Grid2d<T>
where F: FnMut(usize, usize, Scalar, Scalar, Scalar, Scalar) -> T, T: Clone + Send + Sync,

Source

pub fn resample_region<F, T>( &self, range: Range<(usize, usize)>, margin: usize, f: F, ) -> Grid2d<T>

Trait Implementations§

Source§

impl<S> From<&World2d> for World2dData<S>

Source§

fn from(world: &World2d) -> Self

Converts to this type from the input type.
Source§

impl<S> From<&World2dData<S>> for World2d

Source§

fn from(data: &World2dData<S>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V