AcresCoreFarm.h#
Game/Core/Source/AcresCoreFarm.h Generated
What one environment's machines leave on the farm: crushed and harvested crop, wheel ruts and the flags of field work, the per-episode half of FAcresFarmRuntime (Wheel, Body, Cut, Work, Stamp and the cell maps) without Unreal. The crop layout, growth and soil come from the shared FAcresWorld; this holds only the changes, sparsely, so thousands of environments stay small and a reset is a clear().
The accounting is the game's: a tyre stamp crushes the 0.095 m2 samples (4 x 4 per 1.52 m x 1 m patch) inside its footprint rectangle when the contact pressure is over 10 kPa and the crop is past 2 % growth; the body sweep crushes every sample under the machine's footprint whose plants stand taller than the underbody clearance; a sample is crushed once. Ruts: 65 % of the sinkage, at most 0.35 m, never shallower, on 25 cm cells.
The regional crops (FAcresWorld::RegionCrops, outside the tile) have the same accounting. A stamp finds the patches under it on the crop lattice, anywhere on the regional ground. Their crushed samples are kept under the patch's ordinal in the crop file, in RegionCrushed; the 3.45 million patches have no other per-environment state.
Harvest and field work. ACRES Core has no tractor and no implement mechanics: Cut and Work take the header rectangle and the work strip that the game wrote to its episode log (acres_interfaces/FarmStamp, kinds 2 and 3) and give the state of the game. Cut: the mature samples below the header go into the harvested masks, in bit order while they fit in the free room of the bunker (AcresFarm::Harvest); a sample is crushed or harvested, not the two. Work: the 25 cm cells below the strip get the work flags, a cell with a new flag adds 0.0625 m2 to the worked area of its field, and tillage removes the rut of a cell (AcresFieldMarks.h has the walk of the strip). Core does not keep the look of field work (seedbed, rows, spray depth).
One environment's thread only (no locking).
FAcresFarmStamp#
One stamp on the farm (the arguments of FAcresFarmRuntime::Wheel, Body, Cut or Work) and what it did.
| Name | Type | Unit | Default | Description |
|---|---|---|---|---|
Kind |
int |
0 |
0 tyre, 1 body, 2 cut of the harvester, 3 strip of field work. | |
Wheel |
int |
-1 |
0..3 for a tyre, -1 for the body. | |
X, Y, Z, ForwardX, ForwardY, WidthM, LengthM |
double |
Footprint centre, ENU m; heading along the ground (the x, y components of the 3D unit heading, as the game passes them); footprint width across and length along travel, m. | ||
PressurePa, SinkageM, TyreDiameterM, ClearanceM |
double |
Tyre: mean contact pressure, Pa; sinkage, m (0 on hard ground); tyre diameter, m. Body: underbody clearance, m. | ||
CrushedM2 |
double |
0 |
Crop area this stamp crushed, m2, and the field of the last patch it crushed (0: none; 1-59 a tile field, 101-200 a regional field). | |
CrushedByZoneM2 |
double |
Of CrushedM2, the area by task zone (FAcresWorld::ZoneAt; all zone 0 without a zone raster), m2. | ||
bDigger |
bool |
false |
Cut (the header rectangle is X, Y, Z, the heading, WidthM and LengthM): bDigger is the potato digger, which lifts only potato; the grain cutter passes over potato. RoomKg: free room of the bunker before the cut, kg. HarvestedM2 and HarvestedKg: what the cut took. | |
Flags |
uint8_t |
0 |
Work strip (X, Y, the heading, WidthM and LengthM): the work flags (AcresSim::MarkTilled, MarkSeeded, MarkSprayed). WorkedM2: the area that got a new flag (a cell with two new flags counts two times), m2. | |
WorkDepthM, CompactionLayerM |
double |
Tillage (Flags with AcresSim::MarkTilled): the depth of the tools, m, and the layer below a rut that its compaction holds, m (the ground's CompactionLayerM). A rut no deeper than the tools is levelled, a deeper one keeps its depth less the tools'; the compaction below the tools stays (Work). | ||
YieldKgM2, SwathX, SwathY, SwathWidthM, TimeS, MowedM2, SwathKg |
double |
Mow (the cut strip is X, Y, the heading, WidthM and LengthM): YieldKgM2 is the dry matter of the standing crop, kg/m2; the swath strip of the same heading and length has its centre at SwathX, SwathY and the width SwathWidthM; TimeS is the time of the cut. MowedM2: the area that this stamp cut (cells that no stamp cut before); SwathKg: its dry matter, laid on the cells of the swath strip. |
FAcresSwathCell#
The swath on one 25 cm cell: its dry matter over the cell's area, kg/m2, and the time of the last cut that laid crop on it, s (FAcresFarmStamp::TimeS).
FAcresFarmState#
Per-environment farm changes. See the file comment.
| Name | Type | Unit | Default | Description |
|---|---|---|---|---|
Columns |
AcresFarm::FieldColumns |
The soil-water columns of the regional ground (empty: none) and the environment time that waits for the next step of 10 s. | ||
CrushedM2 |
double |
0 |
Crop area crushed since the reset, m2: in total and per field id (AcresFields.h: 1-59 the tile's fields, 101-200 the regional fields; the other entries stay 0). A regional patch counts for the field of its run in the crop file, not for the field raster's cell. | |
CrushedByZoneM2 |
double |
Crushed area by task zone since the reset, m2 (FAcresWorld::ZoneAt). | ||
Crushed |
std::unordered_map<uint32_t, uint16_t> |
Crushed sample masks by patch index (FAcresWorld::Patches); rut depth by 25 cm cell key. | ||
RegionCrushed |
std::unordered_map<uint32_t, uint16_t> |
Crushed sample masks of the regional crop patches by patch ordinal (AcresSim::FRegionCropData). The patch id in logs and saved state is AcresFields::RegionPatchBase + ordinal. | ||
Compaction |
std::unordered_map<uint64_t, float> |
The compaction of each 25 cm cell (CompactionAt) by the key of Ruts, m. | ||
Harvested, RegionHarvested |
std::unordered_map<uint32_t, uint16_t> |
Harvested sample masks by tile patch index and by regional patch ordinal, as Crushed and RegionCrushed. | ||
HarvestedM2, HarvestKg |
double |
Crop area and mass that the cutter took since the reset, in total and the area for each field id. | ||
Worked |
std::unordered_map<uint64_t, uint8_t> |
Work flags by 25 cm cell key (the key of Ruts), and the worked area for each field id (0: outside the fields), m2: [0] tilled, [1] seeded, [2] sprayed. | ||
Swath |
std::unordered_map<uint64_t, FAcresSwathCell> |
The swath layer by 25 cm cell key (the key of Ruts); the area cut and the dry matter laid since the reset, in total, and the area for each field id (0: outside the fields). |
FAcresFarmState::Reset#
Forgets every mark (a fresh farm).
FAcresFarmState::RutAt#
Rut depth of the 25 cm cell under a point, m (0 where no wheel sank).
FAcresFarmState::RutVolumeM3#
The volume of the ruts since the reset, m3: the depth of each 25 cm rut cell x its area (benchmarks.md 3.3).
FAcresFarmState::CompactionAt#
The compaction of the 25 cm cell under a point as the depth of the rut that made it, m (0: none): the deepest rut the cell had since the reset, kept when tillage levels the rut, as long as the compacted layer below the rut (CompactionLayerM thick) reaches below the tools (Work).
FAcresFarmState::Wheel#
Applies a tyre stamp: crushes crop, deepens ruts. Fills Stamp.CrushedM2 and Stamp.Field.
FAcresFarmState::Body#
Applies the body sweep: crushes crop taller than the clearance. Fills Stamp.CrushedM2 and Stamp.Field.
FAcresFarmState::Cut#
Applies one cut of the harvester (FAcresFarmRuntime::Cut after its conditions): harvests the mature samples below the header rectangle, the regional patches first and then the tile patches, as the game does. Fills Stamp.HarvestedM2, Stamp.HarvestedKg and Stamp.Field.
FAcresFarmState::Work#
Applies one strip of field work (FAcresFarmRuntime::Work): the work flags of the cells and the worked area of each field. Tillage (MarkTilled) at a depth d levels the ruts of its cells to max(0, rut - d) (ASSUMED: the tools cut the rut's sides down to their depth) and loosens the soil to d only: the compaction below the tools stays (subsoil compaction below the tillage depth persists: Keller and Or 2022, PNAS 119:e2117699119); a cell's compaction goes only where d reaches below its rut and the layer under it. Fills Stamp.WorkedM2.
FAcresFarmState::WorkedAt#
Work flags of the 25 cm cell under a point (0 where no implement worked).
FAcresFarmState::Mow#
Applies one cut of a mower-conditioner: the cells below the cut strip get the flag AcresSim::MarkMowed; the dry matter of the cells that the flag is new for (their area x Stamp.YieldKgM2) goes, in equal parts, on the cells below the swath strip. The mass is kept: the sum of the swath cells' mass is the sum of Stamp.SwathKg. Fills Stamp.MowedM2 and Stamp.SwathKg. The flag is in the digest's work flags; the mowed area and the swath are not in the digest (the game has no mower yet).
FAcresFarmState::SwathAt#
The swath on the 25 cm cell under a point (0 where none lies).
FAcresFarmState::StartWater#
Starts the soil-water columns of the regional ground at the start state of a scenario (FAcresWorld::StartRegionColumns), or removes them when the scenario has no weather (bWeather false) or the world has no regional field raster. A Reset also removes them: start them again after it.
FAcresFarmState::AdvanceWater#
Advances the farm clock by one physics step and steps the columns in steps of 10 s of environment time, as FAcresFarmRuntime::Advance does. Nothing happens without columns.
| Argument | Description |
|---|---|
Dt |
Physics step, s. |
Conditions |
The weather (RainMmH, EvapMmDay, TimeScale). |
FAcresFarmState::RegionPondLevel#
Water level of the pond of a cell of the regional field raster relative to its ground without ruts, m: the pond of the column fills the deepest of the 256 rut cells of the 4 m cell first (AcresFarm::PondLevel, FAcresFarmRuntime::RegionPondLevel).
| Argument | Description |
|---|---|
FAcresFarmState::StateDigest#
Digest of the state that the game also has (AcresSim::FFarmDigest in AcresFieldMarks.h): the crushed and the harvested samples of the regional patches, the work flags of the cells and the worked area of each field. It is equal to FAcresFarmRuntime::StateDigest for the same stamps.