HighMap library (C++)
Loading...
Searching...
No Matches
species.hpp
Go to the documentation of this file.
1/* Copyright (c) 2025 Otto Link. Distributed under the terms of the GNU General
2 Public License. The full license is in the file LICENSE, distributed with
3 this software. */
4
9#pragma once
10
11#include <cstdint>
12#include <string>
13
15
16namespace hmap
17{
18
23struct Species
24{
25 uint32_t id = 0;
26 std::string name = "";
27 float radius = HMAP_DEFAULT_TREE_RADIUS;
28 float weight = 1.0f;
29 float radius_min = 0.5f * HMAP_DEFAULT_TREE_RADIUS;
30 float radius_max = 1.5f * HMAP_DEFAULT_TREE_RADIUS;
31 float competition_factor = 0.4f;
32
33 Species() = default;
34
35 Species(uint32_t id,
36 float radius = HMAP_DEFAULT_TREE_RADIUS,
37 float weight = 1.0f,
38 float radius_min = -1.0f,
39 float radius_max = -1.0f,
40 float competition_factor = 0.4f,
41 const std::string &name = "")
42 : id(id),
43 name(name),
46 radius_min((radius_min >= 0.0f) ? radius_min : 0.5f * radius),
47 radius_max((radius_max >= 0.0f) ? radius_max : 1.5f * radius),
49 {
50 }
51};
52
53} // namespace hmap
Definition opencv.hpp:20
std::string name
Optional human-readable name.
Definition species.hpp:26
float radius
Nominal canopy / collision radius.
Definition species.hpp:27
uint32_t id
Species identifier.
Definition species.hpp:25
Species(uint32_t id, float radius=HMAP_DEFAULT_TREE_RADIUS, float weight=1.0f, float radius_min=-1.0f, float radius_max=-1.0f, float competition_factor=0.4f, const std::string &name="")
Definition species.hpp:35
float competition_factor
Default intra/inter-species alpha.
Definition species.hpp:31
float radius_min
Minimum viable crown radius.
Definition species.hpp:29
Species()=default
float radius_max
Maximum crown radius.
Definition species.hpp:30
float weight
Relative abundance weight for seeding.
Definition species.hpp:28