-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi Type GP's #616
Comments
I already thought about relaxing the GP constraint. It is not only the mutation, which can destroy the constraints. Also, the initial tree generation must obey the (implicitly) given rules. I haven't found a way of modeling such trees in an intuitive way. It's on my list, but with not the highest priority. |
Where could I start when I would like to implement such a mechanism myself? Could you suggest me a starting point? |
I also need this facility (typed GP sub-trees). A cross-over operator will do the wrong thing when there is more than one "type" involved. DEAP (the python GP project), presents a simple interface to declare operators and typing. https://deap.readthedocs.io/en/master/tutorials/advanced/gp.html Obviously would need to have a more java / jenetics idiomatic representation. Like @3Fish above, I would like to get something like this implemented soonest and will volunteer my time, given some pointers. |
You are welcome, if you want to try to implement this feature. I think we will need an additional interface GenericOp extends Op<Object> {
public Class<?> returnType();
public Class<?> parameterTypeAt(final int index);
public String name();
public int arity();
public Object apply(Object[] args);
} Additionally we will need
|
I was not think of of Type in the sense of java types, rather that may have Ops and Leaf nodes that belong to a different subset of evolutionary operators (where they may all return Double for example). One could have an operation that expects:
but where both types A and B evaluate to Double for example. I suppose one could wrap Double into different classes to create this distinction. I'll have a closer look at the code to better understand what this would entail. I already noticed that the mutation / crossover operators for GP are not in prog, rather in ext. So understanding what is bound with GP or related to the core GA core is a bit more difficult ... |
Is there any update in this field? I tried to figure out a way to plug it in, but the type system in jenetics.prog seems to give no chance of doing that. Instead of proposes GenericOp I thought of Op<T,U>. Unfortunately, I am far not knowledgeable to implement such change |
@c2v4 there is no progress regarding this issue. I have to do some research work myself, which I haven't had the time to do so far. I don't think this will change in the near future. But it's still in the backlog. ;-) |
@jenetics Thanks for the update. I guess I'll have to learn the internals of jenetics.prog and maybe I'll be able to craft something. Unfortunately, I cannot promise to deliver that. |
@3Fish, release 7.1.0 contains classes for Grammatical Evolution (GE), which might be a possibility to do multi type GP. A simple example is given in the GrammaticalJavaScriptEvolution example. Is related with #815 See also |
It would be nice if it would be possible to assign OP's different Types for each Input and the output and let the Mutator check for matching input and output type.
I know that this takes a lot of performance, but it would be possible to shrink the search space significantly.
For Example if building a Rule Generator I have:
operators: AND, OR, >=, NOT
terminals: Ephemeral(1,0), VAR(for each attribute)
But the >= Op should only take terminals as input since it does not make sense to use it further up the tree. And the Not Operator does not make sense with the Ephemeral since it converts just one into the other. Also, double NOT-NOT combinations should be invalid, but I could fix that with a Rewriter.
Example for a generated Tree:
Kind Regards
Dirk Peters
The text was updated successfully, but these errors were encountered: