Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Gene type #155

soheilminer started this conversation in General
Discussion options

Hello everyone,

I'm using this package for my research in stochastic mine planning, and I'm trying to adapt it to my own problem.
I'm just wondering if I can define each gene as a tuple that contains two values, and only perform the crossover/mutation functions on the second value while the first one is fixed. Any help is appreciated.

You must be logged in to vote

Replies: 1 comment

Comment options

Hello,

Yes this is possible using the gene_space parameter. This is an example which makes the value of the first gene fixed (1) and the value of the second one is None so that it can be randomly changed using the GA.

ga_instance = pygad.GA(...,
 gene_space=[[1], None],
 ...)
You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested

AltStyle によって変換されたページ (->オリジナル) /