returning an objective function value with a state corresponding to that objective function

11 views
Skip to first unread message

Aditi MisraSpieldenner

unread,
Mar 25, 2024, 6:29:31 AMMar 25
to deap-users
Hi,
I need to optimise a function which will return a value and the corresponding state vector. So far I am only returning the value to be minimised in the objective function, and it works.
Can you please tell me how do I get the accopanying state as well?
Regards,
Aditi

Rupert Young

unread,
Apr 4, 2024, 6:21:15 AMApr 4
to deap-users
Hi,
Can you describe a bit more about how you have things defined as there could be many ways to do this?

In Python, a function can return multiple parameters. Or if the function is a class method then that class could hold the state vector, which can then be accessed separately.

Regards,
Rupert

Aditi MisraSpieldenner

unread,
Apr 4, 2024, 8:03:33 AMApr 4
to deap-...@googlegroups.com
Hi Rupert,

I actually phrased it wrong. The issue that I am facing is I have 2 sets of chromosomes, one containing integers, another float and I need to optimize on both simultaneously. I cannot figure out how to do that.
 Can you please help me with this?
Regards,
Aditi

--
You received this message because you are subscribed to the Google Groups "deap-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to deap-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/deap-users/d1a8dd0d-489b-405f-ae01-01fe0e1f7698n%40googlegroups.com.

François-Michel De Rainville

unread,
Apr 4, 2024, 8:48:41 AMApr 4
to deap-users
You'll need to define your own crossover and mutation operators. They can wrap deap's crossovers and mutations, one to act on integers and the other to act on floats. You ll need to define the logic to split the individual into its integer and float parts and reassemble it after the operations.

Reply all
Reply to author
Forward
0 new messages