Git Product home page Git Product logo

Comments (5)

zsunberg avatar zsunberg commented on August 15, 2024

Hi @logankilpatrick, solvers sample actions with the rand function. Each time it is called, it generates an action with an angle between 0 and 2*pi. Does that make sense?

from vdptag2.jl.

logankilpatrick avatar logankilpatrick commented on August 15, 2024

Makes sense. What's the advantage to structuring it as it is now with the empty struct?

from vdptag2.jl.

zsunberg avatar zsunberg commented on August 15, 2024

That seems to me like the only way to do it. Did you have another alternative in mind?

from vdptag2.jl.

logankilpatrick avatar logankilpatrick commented on August 15, 2024

You are probably correct about that, I am just unfamiliar with the notion of defining an empty struct like is done above.

from vdptag2.jl.

zsunberg avatar zsunberg commented on August 15, 2024

Ah, yeah, perhaps a better way to think about it is this: the lack of fields in the struct does not mean that it does not contain any information. The compiler knows the type, and hence knows that the angle should be sampled between 0 and 2*pi. There are two ways to encode information in a julia object. Fields encode information that is only known at runtime; the type can encode any information that is known at compile time. Since everything about this action space is known at compile time, there is no need for any fields.

from vdptag2.jl.

Related Issues (8)

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.