Tuesday, July 30, 2013

Planner Framework Progress

Over the past week I have been working on the planner framework, bringing in some code from my main project and implementing and testing various algorithms.
  • BFS
  • Dijkstra's Algorithm
  • A* (assuming monotone heuristics)
  • A* (not assuming monotone heuristics)
  • ARA* (which also assumes monotone heuristics, I believe)
I've set up a simple test scene that uses the grid-based graph domain from my project, which I ported to the new system. This also gave me a test of porting some code from the old system to the new system, and it turned out not to be too difficult.

We may decide rename some portions of the interface, in order to ease transition from the old framework (not sure yet). Right now the interface looks like this.

Here's a video demonstrating all of the planners I've written so far. The next post will probably be about AD*.



Near-future work:

  • Dynamic planner interface
  • AD*
  • Documentation
  • Integration with constraint project

Monday, July 22, 2013

Planner Framework

(Sorry that blog updates have been really sparse--this is partly because I've been working a bit less after the paper, and partly because there is just a lot of uninteresting busywork with the planner framework at this stage.)

This past week, I have been working on a new planner framework based on what I learned about the old one while working on my project. Not a whole lot has happened, yet, but it's picking up. Once it's complete enough, we want to integrate it with both my project and Max's project, which will allow these projects to easily swap planners and to more cleanly integrate with planning code.

The planner framework currently has no dependence on or integration with ADAPT or Unity; it's just a standalone C# project with some basic unit tests. I'll see if I can keep Unity/ADAPT integration as a separate binary, which would allow this framework to be used more generally. I'll have to start on that soon, as I need some sort of visualization so that I can make sure it's actually working.

So far, I have been figuring out the main set of interfaces necessary for the framework. I've implemented a few searches, which have helped me figure out what the interface should look like--though, so far, I have only done some simple things. The domain is a very generic graph-based domain (initialized in the tests). I started with breadth-first search, which provided a very basic test of the interfaces. Then I implemented Dijkstra's algorithm [Node] [MinHeap], which is a little bit more demanding and revealed some things I needed to fix and clean up.

I'm currently working on A* (consistent edition), which implements A* for a consistent/monotone heuristic function. After that will be probably be AD*, or maybe A* (inconsistent edition). Since my project has inconsistent heuristics, I'll be taking that into account when designing things.

For AD* and other repairing algorithms, I will have to provide an abstract class for repairing planners on top of the existing Planner abstract class.

I've also duplicated a feature from the old planner that I don't really understand. The planner has a list of multiple domains, as well as something called "domain evaluation," in which it tries to choose the "best" domain by minimizing a float value returned by domain.Evaluate(startState). So far, domains simply return 0 as their estimate, and I haven't tested any searches with multiple domains. I don't precisely understand how multiple domains would be used by the planner, anyhow, other than simply choosing one and going with it.

Tuesday, July 16, 2013

Paper & future work

I've spent the past few weeks working exclusively on the paper submission. But that's done, so, today, I'll be starting on some other things.

Right now, I'm working on updating and cleaning up the generic planner framework that Francisco started. There is a lot about it that I don't understand, so I have been going through the code and trying to translate it into notes about the common interface between the different planners.

A more generic planner framework should allow easier development with different planners and domains, letting projects swap components more easily.

At the meeting we also discussed increasing the expressiveness of the constraint system. This includes constraints related to considerations like neighborhoods (e.g. avoid these areas), time of day (e.g. don't go here at night), etc. These sorts of constraints should be fairly easy to implement with the existing constraint weighting.

Finally, I'd like to spend some time optimizing the constraint system code. There are a lot of simple "optimizations" that I just haven't had time to figure out--both actual algorithmic optimizations and simple things (e.g. "don't call this code so often")--that should help performance by a lot.

Thursday, July 4, 2013

Dynamic Constraints in AD*

Since I haven't posted recently, here's a quick post about dynamic constraints and AD* replanning.

When a constraint moves, it affects a set of states in the navigation graph. We subsequently tell the planner that its previous knowledge about those states is outdated, causing it to try to replan based on new costs.

Notably, however, with a constantly moving constraint, the planner is not yet fast enough to keep up smoothly--while a constraint is moving through the searched area, if the max-time-per-replan is too low, the plan gets broken and the agent stops and waits for it to be repaired. This is illustrated below:

The initial plan, before it is invalidated by dynamic constraints.
With 100 ms per update to update the plan, the planner keeps up very nicely, immediately switching the plan from one side of the constraint to the other. This slows down the simulation quite a bit.
With just 10 ms per update, the plan becomes broken as the dynamic constraint moves across the searched area. However, it does not slow down the simulation at all.