-
Notifications
You must be signed in to change notification settings - Fork 92
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
Please help with solution min/max boundaries ❓ #140
Comments
One approach is to use the grammar, something like this:
But this would control the min/max size for the entire run, not only during initialisation. (BTW I don't think you should have The min/max tree depth should control tree depth, but in your grammar that should indeed control the number of rules. What went wrong? |
yes, this will work, but I provided simplified version
for example if I need rule be from 5-40, or from 50-100, but I do not want any solution which is smaller than 5/50 rules but if there is no other way, then I will be forced to create gramma with code where I will generate all this crazy combinations of rules. Just want to make sure maybe is somehow possible with configuration so when I'm trying to use
it still gives me rules like:
|
Ok, I see. The point is that the depth is not the same as the number of First, remove the
Second, because of the various rules, even a single So, try a command like this:
|
using gramma like you provided with following settings
this still gives me following:
here is fitness for debug (I always return 0 fitness, because first I want to see that it gives me the correct expressions): class test20(base_ff):
maximise = True
def __init__(self):
super().__init__()
def evaluate(self, ind, **kwargs):
p, d = ind.phenotype, {}
print("**********")
print(p)
return 0 I start thinking that maybe each part of expression counted like Indeed it stop giving me single rules, but this is because I removed single |
Ok! Progress here, but also I do see a bug or two. First, if I change the recursion to be singly-recursive as follows (notice it's no longer
... then this works for me: I am using (11, 15) as the min and max and it is always giving between 5 and 10 I made the change to the grammar because it's easier to reason about when it's singly recursive. Now, every
In fact, depth refers to the depth of the derivation tree (please see any literature on grammars or on GE). With the double recursion |
thanks a lot! |
Hello guys,
first I want to say big thanks for amazing library!
I have a question how to avoid useless small rules and start initialization with bigger number of rules combinations.
I tried using
MIN_INIT_TREE_DEPTH
but could not manage to achieve this.here is my gramma:
this producing phenotypes like:
is it possible somehow to initialize the search that the minimum phenotype will start from 5 rules and maximum will be for example 10 rules. Something like:
p6 > p7 and p1 > p8 and p2 > p3 and p3 > p9 and p1 > p10
or
p6 > p7 and p1 > p8 and p2 > p3 and p3 > p9 and p1 > p10 and p2 < p10
or
p6 > p7 and p1 > p8 and p2 > p3 and p3 > p9 and p1 > p10 and p2 < p10 and p3 < p4 and p4 < p5 and p5 < p6 and p7 < p8
Could somebody please help with the direction?
P.S. by rule I mean single boolean expression like
p5 < p2
The text was updated successfully, but these errors were encountered: