This is a bad code. Overall architecture is crafted in a messy way, that does not consider standard ruby gem organization patterns. This means that you can still use this code, if you want to, but default conventions do not apply here, therefore you should understand the code layout first. Do not depend on this code yet, since it's mostly a rough draft now.
A simple set of classes to assist in implementing algorithms of the Artificial Intelligence course. All this code does is simulates a robot that solves a maze.
$ cd examples
$ ruby solve_dts.rb
Spawned! "Hello!"
Move right_down
Move left_down
Move down
Move right_down
Move right_down
Move right_down
Move down
Move right_down
Move right_down
Move right
Move right
Move right
Move right
$ ruby render.rb
... (solution being rendered)
solve_tree_search.rb
- uses standard tree search algorithmsolve_dls.rb
- uses depth limited search algorithmsolve_ids.rb
- uses iterative deepening search algorithmsolve_dts.rb
- uses two-way (double tree) search algorithm
This is a very badly organized project, for now. Ideally, I should implement some generators to allow building custom stuff upon this project, add some modularity and the ability to reuse code (via gem plugins maybe). But that's not gonna happen, as this is just a course project, and this won't probably be used elsewhere.
- Classes are not properly decoupled.
- Pathfinders have a very unstrict API - each have their own search method.
- SearchContext can sometimes have extra information not needed by particular pathfinder.
- Data flow and ownership in the project is somewhat illogical (due to inheritance of the API from the books).
- Not centristic Task class to define and marshal tasks with all the specific parameters required to solve and render a particular problem.
X
goes right, Y
goes down. Coordinates start at the top left corner of the world.
Left is negative X
, right is positive X
. Up is negative Y
, down is positive Y
.
Strict JSON map format as well as ascii-graphics based map formats are supported.