This repository was archived by the owner on Apr 13, 2024. It is now read-only.
Aditional arguments to objective function #19
rogerfn
started this conversation in
Show and tell
Replies: 3 comments 3 replies
-
@rogerfn make PR if it's possible to u So I did't understand what exactly u want Do u want to use logic like g = 0
def f(x):
global g
g += 1
return x+g
model = ga(f) ? Show me an example how do u plan to use the package with pass arguments |
Beta Was this translation helpful? Give feedback.
2 replies
-
No, those are constant objects.
El mié, 2 jun 2021 a las 23:46, Demetry Pasсal ***@***.***>)
escribió:
… @rogerfn <https://github.com/rogerfn> and u want change a, b during
optimization process???
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://github.com/PasaOpasen/geneticalgorithm2/discussions/19#discussioncomment-818021>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABOLGQDBGZPBEK5OEGDVCGDTQ2RCRANCNFSM456XMKWQ>
.
|
Beta Was this translation helpful? Give feedback.
1 reply
-
Yes, actually that’s what I’m doing. It is mainly have the same or similar
interface as scipy
El El jue, 3 jun 2021 a las 10:53, Demetry Pasсal ***@***.***>
escribió:
… @rogerfn <https://github.com/rogerfn> So why u cannot create carrier
function like
f_local = lambda x: f(x,a,b)
model = ga(f_local)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://github.com/PasaOpasen/geneticalgorithm2/discussions/19#discussioncomment-819635>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABOLGQE7QOC3OVSLO7DNQF3TQ47IDANCNFSM456XMKWQ>
.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Thank you for this very nice package.
I think it would be great to pass arguments to the objective function.
There are some cases where I need to pass an object to the objective function and unfortunately the only way to do that at the moment is to define as a global variable.
I could make a PR for that if necessary
Beta Was this translation helpful? Give feedback.
All reactions