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

Adjust the reproduction cost of each cell individually by clicking the colors in the About tab! #107

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

theomgdev
Copy link
Contributor

@theomgdev theomgdev commented Jan 14, 2022

peek

As it says in the title, you can set the reproduction cost of each cell separately by clicking the colors in the About tab, with load/save support!

I removed the extra mover cost hyperparameter because you can increase the cost of moving organisms by increasing the cost of the mover cell from about tab.

And most important of all, It has almost no effect on performance!

@@ -261,7 +261,11 @@ class Organism {
for (var cell of this.anatomy.cells) {
var real_c = this.c + cell.rotatedCol(this.rotation);
var real_r = this.r + cell.rotatedRow(this.rotation);
this.env.changeCell(real_c, real_r, CellStates.food, null);
if(Hyperparams.cost[cell.state.name] > 0.001) {
this.env.changeCell(real_c, real_r, CellStates.food, {food_value: Hyperparams.cost[cell.state.name]});
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMPORTANT BUG FIX: For example, when the cost of a cell is 0.35 (below 1), the organism spends 0.35 to reproduce that cell, but when that cell dies, it gives 1 food at position. This means 0.65 food that exist out of nothing in the system. To correct this gap, the food cell was given a food_value that was equal to the cost of the cell.

total_cost += Hyperparams.cost[cell.state.name];
}
return total_cost;
return this.total_cost;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Massive performance difference. Now It has almost no effect on performance!

@MaxRobinsonTheGreat
Copy link
Owner

I love this idea and would like to push this in, but the ui needs to be improved. I don't want it in the about tab, and I don't want the input box to interrupt the runtime. One of the potential solutions is to make a new tab where you can click each cell type and edit its properties, like its cost, color, whether it is enabled, and other cell specific properties. This way it can be combined with #104 and more can be built out from there

@theomgdev
Copy link
Contributor Author

I love this idea and would like to push this in, but the ui needs to be improved. I don't want it in the about tab, and I don't want the input box to interrupt the runtime. One of the potential solutions is to make a new tab where you can click each cell type and edit its properties, like its cost, color, whether it is enabled, and other cell specific properties. This way it can be combined with #104 and more can be built out from there

Actually, I was as uncomfortable doing this in the about tab as you were. I thought for a long time.

Playing with CSS a couple of times, I tried shrinking and compressing the cost editing panel to the Evolution Controls tab :D

I couldn't think of a more creative idea and thought that big events like designing a new tab, enlarging the panel, putting a scroll would risk the possibility of my PR being accepted :D

I will give this a hand as soon as possible based on your opinion.

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

Successfully merging this pull request may close these issues.

None yet

2 participants