Evolutionary.jl - positive integers

Hi,

is there a way to tell the optimizer, that the variables should be natural numbers?

I am currently trying to implement this using PenaltyConstraints().
Is there another way?

Thanks

Can you put an abs strategically in your model?

You may have some look inspecting this example:

https://github.com/wildart/Evolutionary.jl/blob/master/examples/mixedint.jl

Thanks for your answers. I am still very new to Julia and programming in general and this forum is very helpful!

@Oscar_Smith:
thanks for the suggestion! I will try it:D

@stephenll:
I followed the example:
I tried to implement the positive property by setting an upper and lower bound(lc and uc) and adding lc and uc to the ConstraintBound function, just like in the example.
Besides, I have another important constraint that has to be met. By varying the penalty factors I am able to weigh those two constraints. Most of the time after the optimization, one of the two constraints was not fulfilled.

Is there a way to implement hard constraints, that always have to be met or should I try to tune the penalty factors? As far as I know, the PenaltyFunction method is a soft constraint.

Thanks