kstaats / karoo_gp

A Genetic Programming platform for Python with TensorFlow for wicked-fast CPU and GPU support.
Other
159 stars 61 forks source link

Logic & Comparison #90

Closed asksak closed 2 years ago

asksak commented 2 years ago

I understand how logic operators and comparison operators are used in the latest Karoo update, however, I was wondering if the a functionality to implement the statement below could be incorporated:

(a if (c>d) or (c>e) else f)

Currently, this is not possible, but this functionality is very important. Boolean algebra order of operations is NOT then AND then OR.

granawkins commented 2 years ago

Yes, that should be supported. It'd be ((a)if(((c)>(d))or((c)>(e)))else(f)).

I see what you mean about parsing order. I think it won't be an issue, because of parenthesis.

asksak commented 2 years ago

Let me test it again, I am sure I bumped into something. Let me get back to you.

Thanks for the brilliant code by the way

asksak commented 2 years ago

Yes, that should be supported. It'd be ((a)if(((c)>(d))or((c)>(e)))else(f)).

I see what you mean about parsing order. I think it won't be an issue, because of parenthesis.

Pardon me, yes it works