Git Product home page Git Product logo

Comments (5)

kchapelier avatar kchapelier commented on June 21, 2024

@Kiborgik Could you provide the code you use to call the function generate ?

from wavefunctioncollapse.

kchapelier avatar kchapelier commented on June 21, 2024

@Kiborgik I've looked further into it, and the error must come from your call. The argument you pass to the generate function, if any, must be a function acting as a random number generator (see doc). If the argument is undefined / null / falsey, it defaults to Math.random, so the only way to trigger this error is by passing an argument which is neither a function nor falsey. I'm guessing you probably have something along the lines of model.generate(Math.random()) where it should actually be model.generate(Math.random).

Let me know if this helps fixing your issue.

from wavefunctioncollapse.

Kiborgik avatar Kiborgik commented on June 21, 2024

Hello, im using code from your example. finished = model.generate(lcg("test"));
Maybe problem with my implementation of lcg(). Thank you for answer.

from wavefunctioncollapse.

kchapelier avatar kchapelier commented on June 21, 2024

@Kiborgik Probably. In my case lcg(...) returns a function which act as a random number generator (a linear congruential generator to be precise). If you don't need to be able to have reproducible results, you can pass Math.random as argument to the generate function otherwise you could look into using the compute-lcg or the seedrandom packages.

from wavefunctioncollapse.

Kiborgik avatar Kiborgik commented on June 21, 2024

Anyway nice work from you. Take care

from wavefunctioncollapse.

Related Issues (6)

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.