GithubHelp home page GithubHelp logo

naqsha's Introduction

NAQSHA Readme

Purpose

The purpose of this project was to develop the Naqsha Class. Naqsha stores and consolidates information about a map, consideration location and walls.

It uses a KDTree as a reference from the coordinates to the Cell locations. It interfaces using the SpacePacket structure to send in and return data about the Cell. For paths it returns a string of edges to choose from the start point to the end point.

Presentation

Here is the link to the project presentation: https://www.youtube.com/watch?v=e92qoYTsPfQ

Acknowledgements

Files

  • KDTree.h: KDTree Class Implementation. KDTree that can save 2D coordinates with a pointer to a any datatype.

  • Cell.h, Cell.cpp: Cell Class Implementation. Defines a unit on the map. Contains the Relation structure that points to other cells around. Has a constant EDGES number of edges, currently at 4.

  • SpacePacket.h: A simple struct that allows communication to and fro Naqsha.

  • Naqsha.h, Naqsha.cpp: Naqsha Class Implementation. The target class of the project. Contains and consolidates info about the map sent through space packets. Can provide shortest path between places if known.

  • RoboSim.cpp RoboSim Implementation. Reads in a text map from a given file. Converts it in SpacePackets and sends them to Naqsha. Then provides an interface to Naqsha to find paths.

  • maze.txt, hugeMaze.txt, noWalls.txt, allWalls.txt Sample maps for testing through RoboSim.

  • testCellRelation.cpp Testing of Cells and Relations. Creates a grid of cells and connects them up. Prints the neighbours of each cell. Also tests the capability of the tree to hold Cell data.

  • testKDTree.cpp Testing of KDTree. Gives an interface for insertion and deletion from KDTree so all cases can be tested by terminal. Every iteration adds a random element in the tree and asks for x, y for deletion.

  • Makefile Makefile for the project. With instructions to build all programs.

  • README Guide to the completed NAQSHA project.

Data Structures and Algorithms:

  • KDTree: KDTree structure is an extension of the concept of BSTrees. While BSTrees are based on a single value that is used to decide a new node's location, this particular KDTrees uses 2. As a result, this structure allows for the coordinates to be referenced to the Cell pointers in a way that makes it really efficient to store, retrieve and delete coordinates.

    The algorithms used in implementation are similar to typical BSTree ones except that they consider the dimension at every level as the dimension alternates at every level.

  • Cell: A Cell represent a vertex if you cosider the map to be a graph. The edges are represented by Relations inside the Cell. This graph based approach is very flexible and allows for a lot of relevant potential algorithms to traverse through them.

  • Recursive Search: This search returns a path by recursively going through all Cells until detination is reached. The path is not guaranteed to be the shortest.

  • Depth First Search: This search runs a Depth First Search considering the distances into account as well. It updates the markers in the Cell containing distance and previous edge for shortest paths. Once the DFS has run. A path extractor is used from the destination to extract the path.

Testing Strategy

KDTree was tested by the testKDTree.cpp and its modifications.

Cell was tested by testCellRelation.cpp and its modifications.

Naqsha was tested by RoboSim.cpp. The maps it was tested with are also included.


Future Plans


  • Use Polar (Radius, Angle) instead of Cartesian (x, y) Coordinates

  • Find Hameltonian Paths/Circuits from a given starting point

  • Test and optimize for edges > 4 and variable edges per Cell

  • Add option for consideration of windows, doorways etc.

naqsha's People

Watchers

 avatar

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.