Coder Social home page Coder Social logo

Comments (7)

KamilKamilS avatar KamilKamilS commented on August 29, 2024 1

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.

PawelDabrowski83 avatar PawelDabrowski83 commented on August 29, 2024

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.

PawelDabrowski83 avatar PawelDabrowski83 commented on August 29, 2024

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.

PawelDabrowski83 avatar PawelDabrowski83 commented on August 29, 2024

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.

KamilKamilS avatar KamilKamilS commented on August 29, 2024

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.

PawelDabrowski83 avatar PawelDabrowski83 commented on August 29, 2024

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.

PawelDabrowski83 avatar PawelDabrowski83 commented on August 29, 2024

I will make tests for both of them :)

from genalgo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.