Code Monkey home page Code Monkey logo

prost's People

Contributors

abcorrea avatar brlauuu avatar geisserf avatar speckdavid avatar thomaskeller79 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

prost's Issues

Merge utility functions of search and parser

Original report by geisserf (Bitbucket: 557058:e7a9f9a5-3ea8-4154-97d2-10446425dce3, GitHub: geisserf).


Currently, search/utils and rddl_parser/utils are nearly identical. A change to one utility function in search often requires copy/pasting the entire file to the parser. Furthermore, while a new implementation could work in search, there could be issues in the parser, that are only noticed after the file was copied, making a lot of extra work.

I propose to merge the utility classes to one location, e.g. src/utils.

Modify clang-format hook script to show code style violations.

Original report by geisserf (Bitbucket: 557058:e7a9f9a5-3ea8-4154-97d2-10446425dce3, GitHub: geisserf).


Currently, whenever a code style violation occurs during a commit, the hook script only shows which files violate the code style, but not where the style is violated. The developer then can:

  • Manually check which lines violate the style: use clang-format on the file, save the output, diff the output with the original file.
  • (clang-)format the whole file without caring which lines violated the style.

Since the first option is cumbersome, a developer might prefer option two; especially when one just wants to commit changes at the end of a day. However, there are times when code style violations are better fixed by refactoring the code in question.

If the first option is already automated by the hook script, developers might be more inclined to refactor some code.

Revise the implementation of logical expressions

Original report by geisserf (Bitbucket: 557058:e7a9f9a5-3ea8-4154-97d2-10446425dce3, GitHub: geisserf).


Our current implementation of logical expressions and related functions has three major disadvantages:

  • no memory management. Whenever a new logical (sub-)expression is created, we have a new raw pointer which never gets deleted, even if the expression is not used anymore. This leads to problems when we implement algorithms with many expression transformations (e.g. EVMDD implementations in our icaps2016 paper).

  • due to the way logical expressions are implemented, methods transforming logical expressions have to do dynamic casting if their logic requires the knowledge of the specific type. This not only leads to boilerplate code, but has also influence on the runtime of such methods, e.g. state evaluation.

  • the current implementation is cumbersome to extend. When we want a new method which works on expressions, it has to be implemented in every expression type (logical_expressions.h has already nearly 1000 lines of code).

A new implementation should consider all three points.

Clean up the code, e.g., by enforcing the use of a coding style convention, by updating to C++11, and by adding more comments.

Original report by tkeller (Bitbucket: 557058:280236d3-4090-4dc9-9a03-b6e1425df4e7, GitHub: thomaskeller79).


There is no clear convention on the coding style that is used within the PROST planner. Diffs between versions therefore become unnecessarily large, which should be avoided when possible. We are currently looking into the Google C++ Style Guide and consider to adapt it to our needs. (issue from 07.12.2015)

Add invariant synthesis

Original report by tkeller (Bitbucket: 557058:280236d3-4090-4dc9-9a03-b6e1425df4e7, GitHub: thomaskeller79).


A task representation where Boolean variables that cannot be true at the same time are merged into finite-domain variables are important for many techniques from classical planning to work properly. Since we have stumbled across this problem several times when trying to port these techniques to MDPs, it is about time to actually add a simple invariant synthesis that is able to find at least some of these finite-domain variables.

Add components that allow description of MCTS algorithms in THTS.

Original report by tkeller (Bitbucket: 557058:280236d3-4090-4dc9-9a03-b6e1425df4e7, GitHub: thomaskeller79).


MCTS algorithms (most importantly, UCT) can be modelled as THTS algorithms, and similar versions can be run in PROST, but they always differ in some details. Adding a random walk search engine and an initialization component that allows to add only a single successor to the tree should suffice to model UCT exactly in the version that is described by Kocsis and Szepesvari. (issue from 26.11.2015)

Introduce goals

Original report by tkeller (Bitbucket: 557058:280236d3-4090-4dc9-9a03-b6e1425df4e7, GitHub: thomaskeller79).


In order to integrate the PPDDL parser, we need a common datastructure both for (finite horizon) RDDL tasks and (goal-oriented) PPDDL tasks. In a first step, we'd like to introduce goals that express that the steps to go variable must be 0. From there, it shouldn't be too hard to generalize to arbitrary goal formulations.

Create shared class for data communction between parser and search

Original report by tkeller (Bitbucket: 557058:280236d3-4090-4dc9-9a03-b6e1425df4e7, GitHub: thomaskeller79).


Create a single class that both writes the output file in the parser component and parses that output in the search component. This is advantageous when new data that has to be communicated is added, as all changes are in a single place.

We could also use this issue to change the output format to a well-known data-interchange format like, e.g., json.

Depends on issue #33, where shared classes between both components are introduced.

Add enum support.

Original report by tkeller (Bitbucket: 557058:280236d3-4090-4dc9-9a03-b6e1425df4e7, GitHub: thomaskeller79).


Supporting finite-domain variables would be a first step towards a richer input language. Currently, only enums are possible to model this feature with RDDL, but they are not supported by PROST (albeit there is some code to parse them). As object-fluents have shown to be a convenient tool in PDDL, we additionally implement a variant in RDDL. (issue from 29.03.2013)

Clean up caching.

Original report by tkeller (Bitbucket: 557058:280236d3-4090-4dc9-9a03-b6e1425df4e7, GitHub: thomaskeller79).


The whole caching or not question is a bit messy currently: In some parts of the code, caching is always enabled (e.g., cacheActionsToExpand in PlanningTask). In others, it depends on the state size (e.g., cachingEnabled in DepthFirstSearch). We should change this by adding a virtual function to the CachingComponent interface that is called initially to decide where caching is used and where not.

RDDL file issue: recon mdp

Original report by Anonymous.


Hi,

Definition of pictureTaken in recon_mdp.rddl is

pictureTaken'(?o) =
KronDelta( exists_{?x : x_pos, ?y : y_pos, ?a: agent, ?t: tool} [CAMERA_TOOL(?t) ^ agentAt(?a, ?x, ?y) ^ objAt(?o, ?x, ?y) ^ useToolOn(?a, ?t, ?o) ^ ~damaged(?t)] );

shouldn't it be

pictureTaken'(?o) =
KronDelta( pictureTaken(?o) | exists_{?x : x_pos, ?y : y_pos, ?a: agent, ?t: tool} [CAMERA_TOOL(?t) ^ agentAt(?a, ?x, ?y) ^ objAt(?o, ?x, ?y) ^ useToolOn(?a, ?t, ?o) ^ ~damaged(?t)] );

Add interm-fluent support.

Original report by tkeller (Bitbucket: 557058:280236d3-4090-4dc9-9a03-b6e1425df4e7, GitHub: thomaskeller79).


Interm-fluents are specified in RDDL, but they can't be used to specify derived fluents that are used in the SACs (because interm-fluents must be evaluated after actions are selected). For that reason, we'd like to have derived-fluents implemented (additionally to interm-fluents), getting an evaluation chain of: 1. Have state. 2. Evaluate derived-fluents. 3. Evaluate SACs to determine applicable actions. 4. Select applicable action. 5. Evaluate interm-fluents based on. 6. Evalute successor state and continue with 1. (issue from 07.12.2012)

IDS training may lead to memory corruption

Original report by geisserf (Bitbucket: 557058:e7a9f9a5-3ea8-4154-97d2-10446425dce3, GitHub: geisserf).


If the IDS learning phase exceeds the time limit for the first depth step of a training state, memory will get corrupted, which may lead to a segfault later on in the search.

This bug appeared in 1 of 6000 runs on the grid (with IPPC2011 as configuration).

The bug is reproducible with
./prost-debug ../../testbed/benchmarks/ippc-all/prost/game_of_life_inst_mdp__10 [PROST -s 1 -se [IPPC2011 -init [Expand -h [IDS -st 0.0000002]]]]
This will however not lead to a segfault.

I was able to reproduce the segfault on my machine with a small hack in depth_first_search.cc, which reproduces the behaviour of the grid. I attached the modified depth_first_search.cc as well as the game of life problem file for which the segfault occurs (of course this bug only appeared with the specific training set of the grid file and not with the training set generated on my machine...).

With these files the following command should lead to a segfault in the first few search steps:
./prost game_of_life_inst_mdp__10 [PROST -s 1 -se [IPPC2011]]

I've tracked down the bug and the reason is that if the timeout already occurs for the first search step (i.e. depth 2) the elapsedTime vector will be resized with 2 iterative_deepening_search.cc:268) and maxSearchDepth is set to 1 (line 269). If the next training state is selected, estimateQValues starts a DFS with a depth of 2 (line 201/202). MoreIterations is called with a depth of 2 and will call line 264: elapsedTime[stepsToGo].push_back(time);,
where stepsToGo is 2, but the size of elapsedTime is 2 (because of elapsedTime.resize(2)), i.e. an out of bounds call.

I think the memory corruption only shows its effect (at least the segfault) when some caches grow too large and are rehashed and specific cache indices are called afterwards, which is why the debug version was not able to detect this segfault (this was fun to find out).

Utility class implementing functions for random number generation

Original report by geisserf (Bitbucket: 557058:e7a9f9a5-3ea8-4154-97d2-10446425dce3, GitHub: geisserf).


Currently random numbers are generated by calling the rand() method, which is terrible.

Besides implementing the generation of random numbers by using , we want a utility class to generate random numbers. The baseline implementation should use the common c++11 way to generate random numbers, but we want to be able to insert some "fake" random engine. This may be useful for testing or for other experimental stuff.

Use clang-format style file to enforce a coding style convention

Original report by geisserf (Bitbucket: 557058:e7a9f9a5-3ea8-4154-97d2-10446425dce3, GitHub: geisserf).


We decided to use clang-format to enforce a certain code style for PROST. After this issue is completed we should have:

  • Removed the uncrustify config file
  • Inserted the .clang-format config file in /src
  • Some way of enforcing the coding style before a push is accepted

The first two points are trivial, attached to the issue is the clang-format style file.

The third point is one worth of more discussion:

  • How do we want to reject pushes?
  • Do we only check for the files which are changed? (This would allow us to close this issue before we converted everything into the new style. Old files will then get updated, whenever someone modifies them.)
  • Do we want a script that modifies commited files by itself before the push, or that tells the contributor which lines of code break the code style and require him to fix it (or to manually call a script)

This issue is related to issue #24.

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.