# Grazing Plan Module Brainstorm

**URL:** <https://farmos.discourse.group/t/grazing-plan-module-brainstorm/1970>\
**Category:** Development\
**Created:** [April 9, 2024, 5:05pm UTC](https://farmos.discourse.group/t/grazing-plan-module-brainstorm/1970 "2024-04-09T17:05:17Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![mstenta](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/mstenta/32/4_2.png) [@mstenta](https://farmos.discourse.group/u/mstenta)\
**Post date:** [April 9, 2024, 6:38pm UTC](https://farmos.discourse.group/t/grazing-plan-module-brainstorm/1970/3 "2024-04-09T18:38:52Z")

</div>

> [@BOTLFarm](#):
>
> I had proposed to them they build the farmOS grazing module similar to the [v1 module](https://github.com/farmOS/farm_grazing).

Some quick thoughts… based on the lessons I learned from the v1 grazing module:

- The v1 module was built very strictly to mimic the Savory Holistic Management techniques, because that is what our sponsor wanted. If I were to approach this again, I would have made a simpler and more generalized Grazing module, and a separate Savory-specific module as a layer on top of that. There are a lot of things in the v1 Grazing module that could be omitted in a general grazing module IMO. It might be worth reviewing and outlining exactly what that module added, and take a pass at conceptually teasing them apart into two lists.
- At the core, I think a grazing plan needs two types of entities:
  1. A `plan` entity of type `grazing`, which represents the plan as a whole, and:
  2. A set of `plan_record` entities of type `grazing_event` (or something like that), which represents a period of time that a set of assets (`group` or `animal`) are in a certain location (both a location asset reference and a unique geometry).

- A `grazing_event` data structure would represent the _planned_ grazing event and might look like this:
  - `plan` - references the plan that the event is a part of
  - `log` - references the `activity` log that will represent the _actual_ movement of the assets, which includes:
    - `timestamp` - the actual movement timestamp
    - `asset` - references the `animal` / `group` asset(s) that are being moved
    - `location` - references the `land` asset that they will be in during the event
    - `geometry` - the specific geometry of the planned grazing event

  - `start` - a timestamp representing the _planned_ start date/time
  - `duration` - how long the animals will be in this place
  - `recovery` - how long the grass will need to recover after the animals leave

- A `grazing` plan could then be visualized in a Gantt style where each row is a `grazing_event`, showing the period of time that the animals are in a place, and the period of time after they leave that is needed for recovery.
- It would be great to reuse the same Gantt chart code that we’ve started developing in the [Crop Plan v3 module](https://github.com/mstenta/farm_crop_plan). @paul121 and I talked about splitting some of that out into a reusable library that we include with farmOS core, so that other module (including core modules) could make use of it in other contexts. If we are able to do that before these students get started, they would be able to leverage that to use the same Gantt visualization for paddock rotations.

Perhaps a good question to help spark more conversation is: what would folks like to have in terms of “planned” vs “actual” data? What is most useful to be able to look back on and learn from, assuming that things always change? 🙂

---

_[View the full topic](https://farmos.discourse.group/t/grazing-plan-module-brainstorm/1970)._
