Code Monkey home page Code Monkey logo

Comments (6)

Svalorzen avatar Svalorzen commented on July 3, 2024

Hey, I think you should be able to use an std::ofstream to just dump the policy into a file, and reload it similarly. See:

http://svalorzen.github.io/AI-Toolbox/namespaceAIToolbox_1_1POMDP.html#a46eee8111107489e3d68d30055722ed8
http://svalorzen.github.io/AI-Toolbox/namespaceAIToolbox_1_1POMDP.html#a17b5a1ad1cf5759d34c6a8470089f9e1

from ai-toolbox.

jocacace avatar jocacace commented on July 3, 2024

Thank you so much for the quick and kindly reply!
I will look to that,

Regards.

from ai-toolbox.

Svalorzen avatar Svalorzen commented on July 3, 2024

Hey, I'm replying here since I like to keep issues public. I've tested the code again just to check that no bugs had crept up in the meantime, and also added an IO test to be sure. I'll push them in a bit.

Can you tell me exactly what you tried to do, what errors you got and what you were expecting? This also helps me figure out how to improve the docs for other people.

from ai-toolbox.

jocacace avatar jocacace commented on July 3, 2024

Dear @Svalorzen. Again thank you.

My idea was to retrieve the policy saving it into a text file, in order to load it later. For this reason I tried the following code:
`

AIToolbox::POMDP::Policy policy(S, A, O, std::get<1>(solution));
ofstream f;
f.open("/tmp/policy.txt",  std::ofstream::out | std::ofstream::app);
f << policy;

However, this code gave me a compilation error, because my compiler was not able to find the correct overload of the operator. Of course, should be an error in my code. More or less, the same thing happens with the >> operator.

`

from ai-toolbox.

Svalorzen avatar Svalorzen commented on July 3, 2024

Did you #include <AIToolbox/POMDP/IO.hpp> in this file?

from ai-toolbox.

jocacace avatar jocacace commented on July 3, 2024

Shame on me!!!
Thanks a lot.. I completely forget to include the header

from ai-toolbox.

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.