Showing posts with label container. Show all posts
Showing posts with label container. Show all posts

March 31, 2025

Using Conditional Containers to Simulate Crop Growing Seasons

 Posted by Jason Lillywhite

Modeling sequential, time-dependent processes lies at the heart of many dynamic simulations. But what happens when the duration of each step is uncertain or changing during the simulation? Consider simulating crop growth stages based on the FAO Irrigation and Drainage paper 56 for modeling crop water demand. Accurately capturing the variability in crop stage durations is important, and ensuring stages trigger correctly using traditional conditional logic can become complex and error-prone under uncertain conditions.  A previous version of the model described here that I built years ago relied heavily on nested IF statements to manage stage transitions. I was always bothered by this implementation, knowing that if the precise duration of each stage wasn't fixed at the simulation start, dynamically ensuring the correct sequence could become extremely difficult to implement reliably.

Screen Capture of the Crop Growing Season Scheduler using Conditional Containers

This post explores how GoldSim's Conditional Containers provide an improved solution. I'll walk through the new version where each growth stage resides in its own Container, dynamically triggered by the completion of the previous one (as shown in the model structure pictured). Discover how this approach not only simplifies the representation of sequential logic but also seamlessly integrates stochastic durations, leading to a more robust, understandable, and maintainable model for Monte Carlo analysis. Read on to see this powerful technique in action! 

May 27, 2015

Playing Mastermind with GoldSim

Posted by Ryan Roper

This last weekend, I went into nerd mode and created a GoldSim version of the classic game Mastermind. If you're not familiar with Mastermind, here's the Wikipedia article about it: Mastermind (board game). According to the article, "Mastermind...is a code-breaking game for two players. The modern game with pegs was invented in 1970 by Mordecai Meirowitz, an Israeli postmaster and telecommunications expert. It resembles an earlier pencil and paper game called Bulls and Cows that may date back a century or more." I play this game with my kids and it often leaves me musing about what kind of strategy or algorithm I might devise to more systematically make guesses to solve the code. This musing usually lasts about 5 or 10 minutes before I decide it's not worth my time and I go on with my life. However, recently I thought it would be a fun and interesting exercise to create a GoldSim version of Mastermind.