Giter Site home page Giter Site logo

cppgoap's People

Contributors

cpowell avatar jdeeth 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cppgoap's Issues

Not finding lowest cost path

So, let's say that we have 3 actions:

  • chopLogs
    • cost: 4
    • preconditions:
      • hasAxe: true
    • effects:
      • hasWood: true
  • getAxe
    • cost: 1
    • preconditions:
    • effects:
      • hasAxe: true
  • collectBranches
    • cost: 8
    • preconditions:
    • effects:
      • hasWood: true

Our goal is to get wood, so:

  • hasWood: true

And our world state is something like this:

  • hasWood: false
  • hasAxe: false

And the planner will choose collectBranches (cost: 8) over getAxe, chopLogs (cost: 5)

Doesn't discriminate on action cost?

If there's two actions with the same preconditions and effects but different costs, it doesn't choose the cheapest option. Instead it seems to choose the first option in the Actions vector.

From the war_game example (with typo fixed in scoutRunning):

  Action scout("scoutStealthily", 999);
  scout.setPrecondition(enemy_sighted, false);
  scout.setPrecondition(weapon_in_hand, true);
  scout.setEffect(enemy_sighted, true);
  actions.push_back(scout);

  Action run("scoutRunning", 15);
  run.setPrecondition(enemy_sighted, false);
  run.setPrecondition(weapon_in_hand, true);
  run.setEffect(enemy_sighted, true);
  actions.push_back(run);

As both actions do the same thing but scoutRunning costs less, I'd expect it to be selected - but instead scoutStealthily is always selected regardless of the costs! And if I put actions.push_back(scout) after actions.push_back(run) then scoutRunning is always selected regardless of the costs.

(I've spent the evening implementing multi-dimensional costs, so scoutStealthily can be slow and safe and scoutRunning can be fast but risky, and the agent can be configured to put more weight on the time cost vs the risk cost (vs the ammo cost vs the health cost... etc). But this error occurs with the code as provided.)

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.