sys

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2026 License: GPL-3.0, GPL-3.0-or-later Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BiofilmGrowth

type BiofilmGrowth struct {
	// contains filtered or unexported fields
}

BiofilmGrowth handles biofilm dynamics for each segment in the model. During Update, it skips processing in winter, computes effective reproduction and capacity values based on environmental parameters (e.g., shade, nutrients, solar radiation), and updates both base and micro-niche biofilm masses over time.

func (*BiofilmGrowth) Finalize

func (bg *BiofilmGrowth) Finalize(w *ecs.World)

Finalize BiofilmGrowth.

func (*BiofilmGrowth) Initialize

func (bg *BiofilmGrowth) Initialize(w *ecs.World)

Initialize the resources for the BiofilmGrowth system.

func (*BiofilmGrowth) Update

func (bg *BiofilmGrowth) Update(w *ecs.World)

Update the BiofilmGrowth system. This function calculates the effective reproduction rate, effective capacity of all compartments, and updates the biofilm mass of all compartments in each segment.

type Development

type Development struct {
	// contains filtered or unexported fields
}

Development manages life cycle transitions of species in each model segment. During Update, it runs every fourth week (except in winter) to simulate species development cycles. For each species, it performs hatching and maturation based on the defined seasonal parameters.

func (*Development) Finalize

func (d *Development) Finalize(w *ecs.World)

Finalize Development.

func (*Development) Initialize

func (d *Development) Initialize(w *ecs.World)

Initialize the resources for the Development system.

func (*Development) Update

func (d *Development) Update(w *ecs.World)

Update the Development system. Iterate over segments and species and execute hatching and becomeMature functions.

type Eutrophication

type Eutrophication struct {
	// contains filtered or unexported fields
}

Eutrophication handles the development of thick biofilm and filamentous algae dynamics across segments. During Update, it manages biofilm occurrence and detachment, as well as filamentous algae growth and decay according to environmental thresholds and random variation.

func (*Eutrophication) Finalize

func (e *Eutrophication) Finalize(w *ecs.World)

Finalize Eutrophication.

func (*Eutrophication) Initialize

func (e *Eutrophication) Initialize(w *ecs.World)

Initialize the resources for the Eutrophication system.

func (*Eutrophication) Update

func (e *Eutrophication) Update(w *ecs.World)

Update the Eutrophication system. For every segment, check if thick biofilm or filamentous algae grow.

type ForageDemand

type ForageDemand struct {
	// contains filtered or unexported fields
}

ForageDemand calculates food demand and available forage for each segment based on species abundance, body mass, and water temperature. During Update, it determines forage availability, resident and immigrant demand, and species-specific grazing rates considering seasonal and physiological responses.

func (*ForageDemand) Finalize

func (fd *ForageDemand) Finalize(w *ecs.World)

Finalize ForageDemand.

func (*ForageDemand) Initialize

func (fd *ForageDemand) Initialize(w *ecs.World)

Initialize the resources for the ForageDemand system.

func (*ForageDemand) Update

func (fd *ForageDemand) Update(w *ecs.World)

Update the ForageDemand system. The state variables Forage, DemandInhabitants, DemandImmigrants and DemandRates of all segments are updated considering water temperature as well as abundance and body mass of the species.

type GenericDisturbance added in v0.1.2

type GenericDisturbance struct {
	// contains filtered or unexported fields
}

GenericDisturbance (StressorMode = generic) handles disturbance events.

func (*GenericDisturbance) Finalize added in v0.1.2

func (gs *GenericDisturbance) Finalize(w *ecs.World)

Finalize GenericDisturbance.

func (*GenericDisturbance) Initialize added in v0.1.2

func (gs *GenericDisturbance) Initialize(w *ecs.World)

Initialize the resources for the GenericDisturbance system.

func (*GenericDisturbance) Update added in v0.1.2

func (gs *GenericDisturbance) Update(w *ecs.World)

Update the GenericDisturbance system. Checks if one or more disturbance events are active in the current week. Active events are applied to all matching segments and species.

type Grazing

type Grazing struct {
	// contains filtered or unexported fields
}

Grazing simulates feeding interactions between species and biofilm within each segment. During Update, it compares available forage with total food demand, updates biofilm depletion, and determines immigration and emigration outcomes caused by drift.

func (*Grazing) Finalize

func (g *Grazing) Finalize(w *ecs.World)

Finalize Grazing.

func (*Grazing) Initialize

func (g *Grazing) Initialize(w *ecs.World)

Initialize the resources for the Grazing system.

func (*Grazing) Update

func (g *Grazing) Update(w *ecs.World)

Update the Grazing system.

type InitGlobals

type InitGlobals struct {
	// contains filtered or unexported fields
}

InitGlobals initializes the model state variables at the beginning of the simulation. During Initialize, it sets the initial biofilm mass for all segments based on parameter values.

func (*InitGlobals) Finalize

func (ig *InitGlobals) Finalize(w *ecs.World)

Finalize InitGlobals.

func (*InitGlobals) Initialize

func (ig *InitGlobals) Initialize(w *ecs.World)

Initialize the resources for the InitGlobals system.

func (*InitGlobals) Update

func (ig *InitGlobals) Update(w *ecs.World)

Update InitGlobals system.

type InitParams

type InitParams struct {
	// contains filtered or unexported fields
}

InitParams initializes model parameters before the simulation starts. During Initialize, it validates parameter consistency, computes derived values such as biofilm capacities, seasonal shade, air and water temperature profiles, and nutrient limitation factors along the river segments.

func (*InitParams) Finalize

func (ip *InitParams) Finalize(w *ecs.World)

Finalize InitParams.

func (*InitParams) Initialize

func (ip *InitParams) Initialize(w *ecs.World)

Initialize the resources for the InitParams system.

func (*InitParams) Update

func (ip *InitParams) Update(w *ecs.World)

Update InitParams system.

type Mortality

type Mortality struct {
	// contains filtered or unexported fields
}

Mortality simulates species mortality processes across all segments of the model. During Update, it applies multiple mortality types including general, temperature-dependent, aging, drift, and threshold-based, according to environmental conditions and model settings.

func (*Mortality) Finalize

func (m *Mortality) Finalize(w *ecs.World)

Finalize Mortality.

func (*Mortality) Initialize

func (m *Mortality) Initialize(w *ecs.World)

Initialize the resources for the Mortality system.

func (*Mortality) Update

func (m *Mortality) Update(w *ecs.World)

Update the Mortality system. This function iterates over all segments and species and applies general mortality, temperature mortality, drift mortality, aging mortality and zero out small abundance mortality.

type PesticideDoseResponse added in v0.1.2

type PesticideDoseResponse struct {
	// contains filtered or unexported fields
}

PesticideDoseResponse (StressorMode = doseResponse) models pesticide effects on aquatic species based on simulated exposure concentrations. During Update, it computes time-weighted average pesticide concentrations for each segment, derives mortality using species-specific dose response parameters, and applies these effects to the respective populations.

func (*PesticideDoseResponse) Finalize added in v0.1.2

func (pdr *PesticideDoseResponse) Finalize(w *ecs.World)

Finalize PesticideDoseResponse.

func (*PesticideDoseResponse) Initialize added in v0.1.2

func (pdr *PesticideDoseResponse) Initialize(w *ecs.World)

Initialize the resources for the PesticideDoseResponse system.

func (*PesticideDoseResponse) Update added in v0.1.2

func (pdr *PesticideDoseResponse) Update(w *ecs.World)

Update updates the PesticideDoseResponse system. The function returns early if it is winter, if the pesticide mode is not set to DoseResponse, or if there is no pesticide injection in the current week. Otherwise, it computes the time-weighted average (TWA) pesticide concentration for each segment, derives the corresponding mortality from the species-specific dose–response parameters, and applies the resulting effects to each species population.

type PesticideGuts added in v0.1.2

type PesticideGuts struct {
	// contains filtered or unexported fields
}

PesticideGuts (StressorMode = guts) simulates toxicokinetic and toxicodynamic processes using the GUTS-RED-SD model. During Update, it computes internal pesticide concentrations for each species and segment, derives instantaneous hazard and mortality, and applies the resulting effects to population abundances over time.

func (*PesticideGuts) Finalize added in v0.1.2

func (pg *PesticideGuts) Finalize(w *ecs.World)

Finalize PesticideGuts.

func (*PesticideGuts) Initialize added in v0.1.2

func (pg *PesticideGuts) Initialize(w *ecs.World)

Initialize the resources for the PesticideGuts system.

func (*PesticideGuts) Update added in v0.1.2

func (pg *PesticideGuts) Update(w *ecs.World)

Update the PesticideGuts system. Returns if it is winter or there is no pesticide injection at current tick. Then calculate the transport transportMatrix.

type PesticideTransport added in v0.1.2

type PesticideTransport struct {
	// contains filtered or unexported fields
}

PesticideTransport simulates pesticide movement through the river segments over time. During Update, it filters weekly injection events and solves the advection/reaction equation for each segment using an upwind finite difference method with numerical dispersion and decay.

func (*PesticideTransport) Finalize added in v0.1.2

func (pt *PesticideTransport) Finalize(w *ecs.World)

Finalize PesticideTransport.

func (*PesticideTransport) Initialize added in v0.1.2

func (pt *PesticideTransport) Initialize(w *ecs.World)

Initialize the resources for the PesticideTransport system.

func (*PesticideTransport) Update added in v0.1.2

func (pt *PesticideTransport) Update(w *ecs.World)

Update the PesticideTransport system. Returns if it is winter or there is no pesticide injection at current tick. Then calculate the transport matrix.

type Reproduction

type Reproduction struct {
	// contains filtered or unexported fields
}

Reproduction simulates the reproductive cycles and dispersal dynamics of species across all segments. During Update, it triggers oviposition for limpets and manages dispersal and reproduction of mayflies and chironomids based on seasonal timing and species-specific parameters.

func (*Reproduction) Finalize

func (r *Reproduction) Finalize(w *ecs.World)

Finalize Reproduction.

func (*Reproduction) Initialize

func (r *Reproduction) Initialize(w *ecs.World)

Initialize the resources and a slice to store the dispersed individuals for the Reproduction system.

func (*Reproduction) Update

func (r *Reproduction) Update(w *ecs.World)

Update the Reproduction system. Iterate over segments and species and execute oviposition function for limpets and dispersal and oviposition functions for mayflies and chironomids.

type WinterBreak

type WinterBreak struct {
	// contains filtered or unexported fields
}

WinterBreak manages the transition into and out of winter conditions within the model. During Update, it sets the winter state based on the current month and resets the flag when winter ends.

func (*WinterBreak) Finalize

func (wb *WinterBreak) Finalize(w *ecs.World)

Finalize WinterBreak.

func (*WinterBreak) Initialize

func (wb *WinterBreak) Initialize(w *ecs.World)

Initialize the resources for the WinterBreak system and set up the biofilm capacities and initial biofilm mass by including fractions.

func (*WinterBreak) Update

func (wb *WinterBreak) Update(w *ecs.World)

Update the WinterBreak system. This function calculates the effective reproduction rate, effective capacity of all compartments, and updates the biofilm mass of all compartments in each segment.

Source Files

  • biofilm_growth.go
  • development.go
  • eutrophication.go
  • forage_demand.go
  • generic_disturbance.go
  • grazing.go
  • init_globals.go
  • init_params.go
  • mortality.go
  • pesticide_dose_response.go
  • pesticide_guts.go
  • pesticide_transport.go
  • reproduction.go
  • utils.go
  • winter_break.go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL