Bug in the Switch function of GeNIe4.0

The front end.
Post Reply
PCherubini
Posts: 11
Joined: Thu Mar 24, 2022 9:00 am

Bug in the Switch function of GeNIe4.0

Post by PCherubini »

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:
Schermata 2022-08-04 alle 18.10.10.png
Schermata 2022-08-04 alle 18.10.10.png (140.04 KiB) Viewed 30 times
2) version with number values:
Schermata 2022-08-04 alle 18.10.36.png
Schermata 2022-08-04 alle 18.10.36.png (71.6 KiB) Viewed 30 times
3) the version with number values works:
Schermata 2022-08-04 alle 18.10.53.png
Schermata 2022-08-04 alle 18.10.53.png (30.14 KiB) Viewed 30 times
The problem is present only with Switch. For example, the "If" operator still works perfectly with text labels
shooltz[BayesFusion]
Site Admin
Posts: 1338
Joined: Mon Nov 26, 2007 5:51 pm

Re: Bug in the Switch function of GeNIe4.0

Post by shooltz[BayesFusion] »

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:

Code: Select all

Node2=If(Node1="State0", value_for_state0, value_for_other_states)
PCherubini
Posts: 11
Joined: Thu Mar 24, 2022 9:00 am

Re: Bug in the Switch function of GeNIe4.0

Post by PCherubini »

Thank you! And yes, in the meantime I can use "if" and "switch" with numerical values
Post Reply