#ifndef _TRIFIXION_H_ #define _TRIFIXION_H_ #include "global.h" #define MAX_ROBOTS 10 /* * Trifixion Class * * Trifixion is the name of this path planner. This object coordinates * all aspects of the path-planning process. It takes in an input * file (or pipe, or whatever) and an output file (or pipe, or whatever), * reads in the input data and outputs a path that solves the problem. * * Trifixion expects to get a set of vertices in the input that is * very simple. It must look like this: * * (int) num_robots * (float) robot1_x_start * (float) robot1_y_start * (float) robot2_x_start * (float) robot2_y_start ... * (int) num_vertices * (float) x1 (x-coord of the first vertex of the env. polygon) * (float) y1 * (float) x2 * (float) y2 ... * * An easy way to provide this input from another source file is to * just pipe that file through a perl script translating to this * format. * * The planner outputs the solution again as a series of vertices. * This time, you get the format: * * (int) num_vertices_for_robot_1_path * (float) x1,1 * (float) y1,1 * (float) x1,2 * (float) y1,2 ... * (int) num_vertices_for_robot_2_path * (float) x2,1 * (float) y2,1 * ... * * Basically the same format. Again, you can pipe the output through a perl * script to spice it up. * * I use this simplified format to cut down on useless text-manipulation * programming. */ class Environment; class State; class Trifixion { public: Trifixion(); ~Trifixion(); void Start(FILE *input, FILE *output); private: void read_input(int *i); void read_input(fixedpt *f); void parse_input(); fixedpt perturbation(); FILE *in; FILE *out; Environment *env; State *state; // Starting information about the robot(s). int num_robots; Vertex *robot_starts[MAX_ROBOTS]; }; #endif /* _TRIFIXION_H_ */