pub struct SeasonalCycle {
pub biome: BiomeType,
pub monthly_temp_c: [f32; 12],
pub monthly_precip_mm: [f32; 12],
pub monthly_humidity: [f32; 12],
pub monthly_sunshine_h: [f32; 12],
}Expand description
Seasonal temperature and precipitation data for a location.
Fields§
§biome: BiomeType§monthly_temp_c: [f32; 12]Monthly mean temperatures (°C) — 12 values Jan–Dec.
monthly_precip_mm: [f32; 12]Monthly precipitation (mm) — 12 values.
monthly_humidity: [f32; 12]Monthly mean humidity [0,1].
monthly_sunshine_h: [f32; 12]Monthly sunshine hours (average per day).
Implementations§
Source§impl SeasonalCycle
impl SeasonalCycle
Sourcepub fn from_biome(biome: BiomeType, latitude: f32) -> Self
pub fn from_biome(biome: BiomeType, latitude: f32) -> Self
Build a simple sinusoidal cycle from biome parameters.
Sourcepub fn temperature_at_month(&self, month_frac: f32) -> f32
pub fn temperature_at_month(&self, month_frac: f32) -> f32
Interpolated temperature for fractional month (0.0 = Jan 1, 11.999 = Dec 31).
Sourcepub fn day_to_month_frac(day: f32) -> f32
pub fn day_to_month_frac(day: f32) -> f32
Convert day-of-year [0,365) to fractional month index.
pub fn humidity_at_month(&self, month_frac: f32) -> f32
pub fn precipitation_at_month(&self, month_frac: f32) -> f32
Trait Implementations§
Source§impl Clone for SeasonalCycle
impl Clone for SeasonalCycle
Source§fn clone(&self) -> SeasonalCycle
fn clone(&self) -> SeasonalCycle
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for SeasonalCycle
impl RefUnwindSafe for SeasonalCycle
impl Send for SeasonalCycle
impl Sync for SeasonalCycle
impl Unpin for SeasonalCycle
impl UnsafeUnpin for SeasonalCycle
impl UnwindSafe for SeasonalCycle
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.