I've just updated to version 4.0 of GeNIe, and by loading models that I built on version 3 I found a bug in the switch conditional operator. I run genie on a mac through crossover, so I do not know if the bug will replicate on a PC.
In a nutshell: the switch command now recognizes the numerical values of discrete states, but it does not recognzie their text labels.
Screenshots follow, based on an ad hoc mini-network built just for illustrating the bug:
1) version with text, and error report:
2) version with number values:
3) the version with number values works:
The problem is present only with Switch. For example, the "If" operator still works perfectly with text labels
Bug in the Switch function of GeNIe4.0
-
- Site Admin
- Posts: 1443
- Joined: Mon Nov 26, 2007 5:51 pm
Re: Bug in the Switch function of GeNIe4.0
Thanks for spotting the bug. We'll fix it in the next service release.
As a temporary workaround, please consider using the If() function, which supports state literals in GeNIe 4.0. For example:
As a temporary workaround, please consider using the If() function, which supports state literals in GeNIe 4.0. For example:
Code: Select all
Node2=If(Node1="State0", value_for_state0, value_for_other_states)
-
- Posts: 29
- Joined: Thu Mar 24, 2022 9:00 am
Re: Bug in the Switch function of GeNIe4.0
Thank you! And yes, in the meantime I can use "if" and "switch" with numerical values
-
- Site Admin
- Posts: 1443
- Joined: Mon Nov 26, 2007 5:51 pm
Re: Bug in the Switch function of GeNIe4.0
This bug was fixed in the most recent release (4.0.2221).