Comments (7)
I don't understand what do you mean by overflow.
I think that both formula works (when we use as a constant 65535 instead of 100)
I agree that we can implement both formulas or one and then considered if any changes in case of this formula are needed.
from genalgo.
I am thinking about formula to estimate how good is current value to the target value. The best I have for now is:
target / (target + delta)
where delta is difference between target and current value: mod(target - value)
This function obviously does not work if target=0, because we cannot divide by zero.
from genalgo.
My friend who is studing math suggested this formula:
1 / (1+(delta/100)) for delta <= 100
50 / delta for delta > 100
it is valid for target=0 and it should be precise enough to generate different fitness even for lower delta (difference between target and value)
from genalgo.
And he suggested this as a single formula. I tried it with different values and I think it will be very fine for us:
1 / (1+log(1+delta))
from genalgo.
I have also fought about the formula and have a slightly different idea.
My formula = (100 - delta) / 100
where "100" is constant value.
delta - the difference between target and current char (the same as above)
instead of using the target value we can use simply 100. There is no problem with dividing by zero.
And the best fitness value is equal to 1. (100/100) where delta = 0.
What do you think about this?
from genalgo.
Yes, but if I understand correctly the constant should be equal to max value of our target, because we want formula to work for maximum delta (max char value - min max value). Char in utf-8 takes values 0-65535, so 65535 is maximum delta.
This is the case, where our target is 'c', so number 99 and Genes takes some values - comparison of fitness from two formulas: https://ibb.co/xDXgSHF
If const value is smaller than max delta, we risk overflow: https://ibb.co/KjSn77z
But after all, we can implement both of this formulas or even more, because Evaluator is only an Interface and can have multiple variances of implementation.
from genalgo.
I will make tests for both of them :)
from genalgo.
Related Issues (20)
- CrossoverService factory - impl
- Mutator builder - docs
- Mutator Factory - test
- Mutator Factory - impl
- Stage 14 description
- test GenePool.getSolve czy zwraca target
- MainIntegrationTest fix method shouldReturnListOfGeneWithTargetValue()
- Mutator Factory fix - test
- Mutator Factory fix - docs
- MutatorFactory - impl refactor
- GenePoolService Bulder impl
- GenePoolService Bulder test HOT 1
- GenePoolService Bulder docs
- MutatorConfig
- CrossoverServiceFactory test - class constraint <T> on parameterized test argument
- MutatorFactoryTest refactor
- Stage 15 description
- Target is stored in both Evaluator and SolutionFinder on separate fields, which is not good
- Hot fix - bug on merging commits
- Stage 16 description
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from genalgo.