/AI_Assn1

Artificial Intelligence Assignment 1

Primary LanguageC++

CPSC 3750 Artificial Intelligence Assignment 1 Programming portion: Polygon Search University of Lethbridge Name: Justin Petluk, ID# 001190085 Date: January 31, 2018

Compile instructions: make : compiles the program

ai_proj is the executable. make run : executes the program (if it's easier to type)

Description: Using external and open resources (convexHull algorithm) along with personal code, this program generates a set of convex polygons and navigates from start to finish using only visible points along the way.

The polygons created are made from creating a convex hull from randomly generated points in a specified area. To generate regular shapes, set "regular" to true. Note: Points == vertex when defined around it's origin.

The agent will view the environment and determine which is visible. From there, it will create a structure according to the search process and repeat the process of determining which is visible from the new point. Visibility is declared by distance and slope from current point to adjacent vertices in a shape. If a point exists behind the given distance and within this angle, it will not be "shown".

Classes: Agent

  • This is what accesses the environment and makes decisions.

ConvexHull(Look at credits for source)

  • These are used to create convex polygons (specified in project).

Environment

  • This is what contains the shapes and their vertices.
  • Contains the agent and provides the start and finish points.
  • Contains a point to define max X,Y limit of the shape origins. Shapes points can be defined outside, but their origins cannot. WARNING: There exist limits to the amount of shapes that can exist in the environment. The shapes are regenerated in a different, random position in the space if they are within another shape. If there is too many shapes, this will loop forever.

Geometry

  • This class organizes points generated by the convexHull algorithm
  • Allows checking of edges for visibility. ?

Credits to: