Code Monkey home page Code Monkey logo

Comments (3)

fdabrandao avatar fdabrandao commented on September 23, 2024

Hi Bob,

GSL looks for the values of the environment variables GSL_RNG_TYPE and GSL_RNG_SEED in https://github.com/ampl/gsl/blob/master/rng/default.c. In case there were values set for these environment variables, it display the values when the dll is loaded:

ampl: option GSL_RNG_TYPE 'taus'; # use the "taus" generator
ampl: option GSL_RNG_SEED 123;    # initialize the seed to 123
ampl: load amplgsl.dll;
GSL_RNG_TYPE=taus
GSL_RNG_SEED=123

On Linux, option GSL_RNG_TYPE 'taus'; and option GSL_RNG_SEED 123; set the environment variable correctly. However, on Windows this does not happen, and the only workaround appears to be the one you suggested using set GSL_RNG_SEED to set the environment variable manually before starting AMPL. The problem may be in the implementation of the function that sets the options.

Regarding the standard randseed option, it does not appear to have any effect on GSL (even on Linux), and in the implementation I do not see anything that would set the environment variable GSL_RNG_SEED when randseed is set. Since that note refers to AMPL version 20120830, this behavior may have been meanwhile discarded, or at the time GSL loaded these values from some place other than environment variables.

from gsl.

4er4er4er avatar 4er4er4er commented on September 23, 2024

Comment left at https://groups.google.com/d/msg/ampl/xWjhox8FfeQ/guOyWCIbBgAJ:

The gsl libraray has a function called gsl_rng_set which is not included in ampl/gsl. Probably including that function and related files (not sure about the dependency), and rebuild the gsl library can be a way to go.

from gsl.

mapgccv avatar mapgccv commented on September 23, 2024

Added functionality in e4454c1, see https://amplgsl.readthedocs.io/en/latest/amplgsl/rng.html.

from gsl.

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.