Jump to content

Complex Selection Condition doesn't work?


Damarow
 Share

Recommended Posts

Hello,


a similar question from 2015 was not answered http://www.simio.com/forums/viewtopic.php?f=6&t=1936&p=6252&hilit=selection+condition#p6252.


I have the same problem. I want to use a rather complex selection condition, but they don't work. For example:

((Server1.AttributeA == 1) == (Server2.AttributeB == 2))

or

Math.If((Candidate.Node.AssociatedObject.Is.TypeA),something)

 

I checked my conditions extensively and they should work, but they dont. It seems only "simple" selection onditions work.


Does anyone know something about that?

Link to comment
Share on other sites

The first expression you wrote is not a selection condition but a logic statement, that can evaluate to 1 or 0. For selection you need to use the Candidate construct as in the second expression. E.g.

((Candidate.Server.AttributeA == 1) && (Candidate.Server.AttributeB == 2))

Mind that there is a difference between using .Is and ==, the first of which checks if the candidate belongs to a particular class, and the latter checks for a value.


Finally, AssociatedObject to a node might not be assigned. Make sure it is and that it is of the right class.

Link to comment
Share on other sites

×
×
  • Create New...