Skip to content

MOZGIII/forest-rb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 

Repository files navigation

WARNING

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.

AI Framework

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.

Usage

Running examples

$ 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)

Examples list

  • solve_tree_search.rb - uses standard tree search algorithm
  • solve_dls.rb - uses depth limited search algorithm
  • solve_ids.rb - uses iterative deepening search algorithm
  • solve_dts.rb - uses two-way (double tree) search algorithm

Status

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.

Problematic parts

  • 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.

Axis

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.

Map formats

Strict JSON map format as well as ascii-graphics based map formats are supported.

About

AI course project lives here

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages