Skip to content
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

Limited food seems to prefer long teeth #161

Closed
amanda-phet opened this issue Aug 5, 2020 · 11 comments
Closed

Limited food seems to prefer long teeth #161

amanda-phet opened this issue Aug 5, 2020 · 11 comments

Comments

@amanda-phet
Copy link
Contributor

Related to #158 maybe. Just an extension of the limited food issue.

I am experimenting with Limited Food and different mutations. When I add the long teeth mutation, the log will frequently read out No bunnies with long teeth were starved because the population is <= 4. but teeth should not matter for limited food. This happens whether long teeth are dominant or recessive.

You can see in the graph during generation 2 here, none of the bunnies with long teeth died, and the log confirmed it.

image

Also here in generations 4, 5, and 8.
image

@amanda-phet
Copy link
Contributor Author

For phetsims/qa#522

@amanda-phet
Copy link
Contributor Author

Using Mac, Chrome, and rc.1

@pixelzoom
Copy link
Contributor

It would be helpful to have the log and any query parameters that you used.

@pixelzoom
Copy link
Contributor

Since @amanda-phet noted "For phetsims/qa#522" I'm going to assume that this is blocking for the 1.0 prototype. Labeling as "blocks-sim-publication". If that's incorrect, let me know.

@amanda-phet
Copy link
Contributor Author

No need to add a mutation for teeth. Here is the log after adding a mate, turning on limited food at the start of generation 3:

====== Generation 1 ======
natural-selection_all_phet.html?log:81 0 bunnies died of old age
natural-selection_all_phet.html?log:81 4 bunnies were born
natural-selection_all_phet.html?log:81 attempting to starve bunnies
natural-selection_all_phet.html?log:81 total live bunnies = 6
natural-selection_all_phet.html?log:81 total dead bunnies = 0
natural-selection_all_phet.html?log:81 ====== Generation 2 ======
natural-selection_all_phet.html?log:81 0 bunnies died of old age
natural-selection_all_phet.html?log:81 using bunnyRestRange=[2,7] for population=10
natural-selection_all_phet.html?log:81 12 bunnies were born
natural-selection_all_phet.html?log:81 attempting to starve bunnies
natural-selection_all_phet.html?log:81 total live bunnies = 18
natural-selection_all_phet.html?log:81 total dead bunnies = 0
natural-selection_all_phet.html?log:81 ====== Generation 3 ======
natural-selection_all_phet.html?log:81 0 bunnies died of old age
natural-selection_all_phet.html?log:81 36 bunnies were born
natural-selection_all_phet.html?log:81 attempting to starve bunnies
natural-selection_all_phet.html?log:81 No bunnies with long teeth were starved because the population is <= 4.
natural-selection_all_phet.html?log:81 36 bunnies with short teeth died of starvation

The examples above show the concern, which is that someone might think limited food selects for a certain phenotype when it should not.

@amanda-phet amanda-phet removed their assignment Aug 5, 2020
@pixelzoom
Copy link
Contributor

pixelzoom commented Aug 6, 2020

Yes, limited food will prefer long teeth in specific circumstances, and that's what you requested.

In #153, you asked to ignore limited food if the total population (not the population of a specific phenotype) is < 7. It's not in this case, so limited food will be applied.

In #98 (comment), you asked for:

  • Have the selection factor ignore preferred phenotype if fewer than N exist

This constraint is specific to the "long teeth" phenotype, and we settled on N <= 4. In your example, the number of bunnies with long teeth is <= 4, so they are not affected by limited food, and are therefore "preferred"

Does that make sense? Or did I misunderstand the requirements?

@pixelzoom pixelzoom assigned amanda-phet and unassigned pixelzoom Aug 6, 2020
@amanda-phet
Copy link
Contributor Author

This constraint is specific to the "long teeth" phenotype, and we settled on N <= 4. In your example, the number of bunnies with long teeth is <= 4, so they are not affected by limited food, and are therefore "preferred"

The constraint of N <= 4 was for long teeth (when tough food is checked) or fur color (when wolves are checked). Since limited food doesn't have a preferred phenotype (and the model clearly reflects this when the population is large, regardless of mutations), it should not prefer long teeth at any time.

@amanda-phet
Copy link
Contributor Author

I said

The constraint of N <= 4 was for long teeth (when tough food is checked) or fur color (when wolves are checked).

And it looks like for fur color the constraint is <= 5. I am starting to get confused about this, because I thought we picked one value for this constraint. I'll need to review #98 for this.

However, we still need to do something about limited food, because this constraint should not apply.

@amanda-phet
Copy link
Contributor Author

I reviewed the mutation model and found #98 (comment), which is helpful to confirm that I indeed picked different values for the constraint. That's fine that the values are different, but I should have reviewed the model with ?log turned on way back when I approved it, because I didn't notice this issue (that limited food prefers long teeth when N≤4) until just now when watching the log more closely. Limited food works fine with larger populations, and doesn't care about teeth or any other traits, so we just need to fix the constraint.

@pixelzoom
Copy link
Contributor

Thanks for clarifying, I'll fix the long teeth + limited food problem.

@pixelzoom
Copy link
Contributor

Food.starveBunnies has been heavily refactored, and this should now be fixed. We'll verify in #169, so closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants