Open BrianCollinss opened 4 months ago
Hi @peter-devoil . By any chance, did you get to have a look at this issue? Cheers.
It is possible to create a loop in the rotation that transitions endlessly. The algorithm says "keep making transitions until no more can be performed". If you have a loop between the two fallow states that relies on the "NotPlanted" rules, it will make that transition forever
Sorting this out isn't easy with summary file messages as they get written at the end of the run (which never happens), but using Console.Writeline() and looking at the stdout will give you a clue which tests are involved.
If you have a loop between the two fallow states that relies on the "NotPlanted" rules, it will make that transition forever
What I struggle to understand is that even if all crops are not planted in one season, the rotation must still continue since at least one crop will be harvested in the future (could be next season or not). I am unsure why this loop gets stuck though. Even if no crop is evet planted, the sim must end in one of the fallows.
I added a print statement to each manager:
and when the the system is fallow:
and had to kill it. The logic each day is "keep making transitions until no more can be performed".
Ah ... what is happening!?
The logic each day is "keep making transitions until no more can be performed".
I assumed when no transition is made, APSIM simply moves on to the next day while keeping the current state. Seems I was wrong!
A transition is made from fallow1 to fallow2. Then, it realises that it can transition to fallow1. Then, it realises that it can transition to fallow2....
I usually add an arc that can be traversed one day after the sowing window closes (eg dayIs("11-jun")). It wont trigger at any day other than 11-jun.
What happened?
My goal is to have a rotation which can skip crops if planting criteria are not met (see https://github.com/APSIMInitiative/ApsimX/discussions/9108).
I tested this setup without having the 'Initial' node as well (where Rotation started at 'Fallow1'), but the same happened.
Rotation.zip
What Operating System are you on?
Windows