载入中...
搜索中...
未找到
eve::growth::GrowthWorld类 参考

Owner of calendar, RNG seed, and the sole simulation advance path. 更多...

#include <GrowthSystem.h>

Public 成员函数

 GrowthWorld ()=default
 
Result< void > setSecondsPerSimDay (double seconds) noexcept
 Seconds of SimulationStep.delta that equal one simulation day.
 
double secondsPerSimDay () const noexcept
 
void setRngSeed (std::uint64_t seed) noexcept
 Deterministic seed for disease / yield hash streams.
 
std::uint64_t rngSeed () const noexcept
 
GrowthCalendar & calendar () noexcept
 
const GrowthCalendar & calendar () const noexcept
 
GrowthEventLog & events () noexcept
 
const GrowthEventLog & events () const noexcept
 
Result< void > step (const SimulationStep &step)
 Converts a fixed SimulationStep into fractional sim days and advances. @cost Linear in live organism count for the fractional day span.
 
Result< void > advanceDays (double days)
 Advances every live organism by simulation days (may be fractional). @cost Linear in organism count × whole-day crossings for calendar events.
 
Result< void > tryBreed (Organism &carrier, Organism &partner)
 Starts pair_gestation on carrier when both partners satisfy the species rules. @cost Cheap validation + component write; offspring spawn on later advance.
 
Result< void > tryReproduce (Organism &organism)
 Triggers a solo reproduction pulse for self_bud / fission / spore_burst.
 
void resetForTests ()
 Clears organisms' world-facing bookkeeping used by tests (events + calendar).
 

静态 Public 成员函数

static GrowthWorld & instance ()
 Process-wide world used by Organism helpers and the Growth module.
 
static void resetInstance ()
 Replaces process instance with a fresh world (tests).
 

友元

class Organism
 

详细描述

Owner of calendar, RNG seed, and the sole simulation advance path.

Callers inject SimulationStep (or explicit sim days). Wall clock is never read.

在文件 GrowthSystem.h 第 19 行定义.

构造及析构函数说明

◆ GrowthWorld()

eve::growth::GrowthWorld::GrowthWorld ( )
default

成员函数说明

◆ advanceDays()

Result< void > eve::growth::GrowthWorld::advanceDays ( double  days)

Advances every live organism by simulation days (may be fractional). @cost Linear in organism count × whole-day crossings for calendar events.

在文件 GrowthSystem.cpp 第 104 行定义.

引用了 eve::growth::GrowthCalendar::advanceWholeDays(), eve::growth::GrowthCalendar::dayIndex(), eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::growth::Organism::isDead(), eve::growth::Organism::liveOrganisms() , 以及 eve::Result< T >::success().

被这些函数引用 eve::growth::Growth::advanceDays() , 以及 step().

◆ calendar() [1/2]

const GrowthCalendar & eve::growth::GrowthWorld::calendar ( ) const
inlinenoexcept

在文件 GrowthSystem.h 第 32 行定义.

◆ calendar() [2/2]

◆ events() [1/2]

const GrowthEventLog & eve::growth::GrowthWorld::events ( ) const
inlinenoexcept

在文件 GrowthSystem.h 第 34 行定义.

◆ events() [2/2]

◆ instance()

◆ resetForTests()

void eve::growth::GrowthWorld::resetForTests ( )

Clears organisms' world-facing bookkeeping used by tests (events + calendar).

在文件 GrowthSystem.cpp 第 89 行定义.

引用了 eve::growth::GrowthEventLog::clear() , 以及 eve::growth::GrowthCalendar::reset().

◆ resetInstance()

void eve::growth::GrowthWorld::resetInstance ( )
static

Replaces process instance with a fresh world (tests).

在文件 GrowthSystem.cpp 第 62 行定义.

引用了 eve::growth::Organism::liveOrganisms().

被这些函数引用 eve::growth::Growth::resetWorld().

◆ rngSeed()

std::uint64_t eve::growth::GrowthWorld::rngSeed ( ) const
inlinenoexcept

在文件 GrowthSystem.h 第 29 行定义.

◆ secondsPerSimDay()

double eve::growth::GrowthWorld::secondsPerSimDay ( ) const
inlinenoexcept

在文件 GrowthSystem.h 第 25 行定义.

◆ setRngSeed()

void eve::growth::GrowthWorld::setRngSeed ( std::uint64_t  seed)
inlinenoexcept

Deterministic seed for disease / yield hash streams.

在文件 GrowthSystem.h 第 28 行定义.

引用了 seed.

被这些函数引用 eve::growth::Growth::setRngSeed().

◆ setSecondsPerSimDay()

Result< void > eve::growth::GrowthWorld::setSecondsPerSimDay ( double  seconds)
noexcept

Seconds of SimulationStep.delta that equal one simulation day.

在文件 GrowthSystem.cpp 第 70 行定义.

引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument , 以及 eve::Result< T >::success().

被这些函数引用 eve::growth::Growth::setSecondsPerSimDay().

◆ step()

Result< void > eve::growth::GrowthWorld::step ( const SimulationStep &  step)

Converts a fixed SimulationStep into fractional sim days and advances. @cost Linear in live organism count for the fractional day span.

在文件 GrowthSystem.cpp 第 95 行定义.

引用了 advanceDays(), eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument , 以及 step.

被这些函数引用 eve::growth::Growth::stepSeconds().

◆ tryBreed()

◆ tryReproduce()

友元及相关函数文档

◆ Organism

friend class Organism
friend

在文件 GrowthSystem.h 第 70 行定义.


该类的文档由以下文件生成: