Hi fellow farmers,
Currently, the Food Computer 2.0 runs environmental recipes defined as a time series in JSON. This is great for being able to define exactly what you want in your environment, down to the second, but it is difficult to author.
Luckily, our system supports plugging in adapters for multiple recipe formats. One format we’ve been thinking about is an easy-to-author “phase-based” YAML file. It would look something like this:
Some questions and thoughts:
- Should phases in phase-based recipes always start with day?
- What happens when the stage duration and phase duration don’t divide
evenly? So for example, if a stage is 18hrs and happens to end at hr 6
of a 12hr day cycle, and the next stage also starts with a day cycle,
you could end up with a crazy long day when switching between stages
10:36. Maybe we should define stages in terms of multiples of day/night cycles?
- We could also just finish the full cycle before transitioning stages. So duration would be
"roughly this many days".
- Should day/night cycles have sensible defaults? (e.g. light is on by default during day unless otherwise specified). Leaning toward “yes”.
- In addition to having a phase recipe adapter, we could create to/from conversion scripts so you can use either recipe format interchangeably.
Do you have other ideas for this format? How would you optimize it for ease-of-authorship? In what ways would you improve it?
Hat tip to @jake for this idea, and for authoring the original YAML example.