15 #ifndef CORE_BEHAVIOR_GENE_REGULATION_H_
16 #define CORE_BEHAVIOR_GENE_REGULATION_H_
45 Base::Initialize(event);
47 auto* other =
event.existing_behavior;
53 "other was not of type GeneRegulation");
67 real_t initial_concentration) {
78 auto* param = sim->GetParam();
79 auto* scheduler = sim->GetScheduler();
81 const auto& timestep = param->simulation_time_step;
82 uint64_t simulated_steps = scheduler->GetSimulatedSteps();
83 const auto absolute_time = simulated_steps * timestep;
85 if (param->numerical_ode_solver == Param::NumericalODESolver::kEuler) {
91 }
else if (param->numerical_ode_solver == Param::NumericalODESolver::kRK4) {
94 real_t interval_midpoint = absolute_time + timestep / 2.0;
95 real_t interval_endpoint = absolute_time + timestep;
Contains code required by all agents.
void AlwaysCopyToNew()
Always copy this behavior to new agents.
void Initialize(const NewAgentEvent &event) override
BDM_BEHAVIOR_HEADER(GeneRegulation, Behavior, 1)
std::vector< real_t > concentrations_
Store the current concentration for each gene.
void Run(Agent *agent) override
std::vector< std::function< real_t(real_t, real_t)> > first_derivatives_
virtual ~GeneRegulation()=default
void AddGene(const std::function< real_t(real_t, real_t)> &first_derivative, real_t initial_concentration)
const std::vector< real_t > & GetValues() const
static void Fatal(const std::string &location, const Args &... parts)
Prints fatal error message.
static Simulation * GetActive()
This function returns the currently active Simulation simulation.