SteerSuite Code Reference
This set of pages is doxygen-generated documentation of the SteerSuite code. This includes SteerLib, the main library of SteerSuite, as well as the code from all other tools.
In addition to the code reference, there is also a User Guide and Reference Manual. The User Guide walks through the main features of SteerSuite and how to use them. The Reference Manual describes all test cases, metrics, benchmark techniques, modules, command line tools in SteerSuite.
Useful Starting Points for Programming with SteerLib
- The User Guide has an entire chapter on using SteerLib, including simple steps to include and link SteerLib into your own code.
Simulations and modules:
Developing your own AI:
- The SteerLib::BestFirstSearchPlanner is a template class that implements a best-first search. You define the state space and action space for the planning task by implementing the functionality in SteerLib::StateSpaceBase. By varying the heuristic, you can make the search behave like A* or any other best-first search technique.
- The SteerLib::GridDatabase2D is a very useful spatial database that allows you to perform nearest-neighbor lookups, ray tracing queries, path-finding queries, and more. This class is essential for agents to be able to "see" things in the environment in various ways.
- The Util::StateMachine may be helpful for keeping track of valid and invalid transitions between states.
Reading test cases and recordings:
- The SteerLib::TestCaseReader class is an easy way to read XML test cases. It automatically parses the XML and sets up the initial conditions of the test case, and all you have to do is query the initial conditions to initialize your own code.
- The SteerLib::RecFileWriter class is used to create a recording of a steering simulation. You only need to be able to specify the position and orientation of each agent in each frame.
- The SteerLib namespace includes more functionality, including metrics computations, benchmarking techniques, a spatial database, etc.
- The Util namespace contains very useful general functionality, mostly platform-independent. This includes functionality for loading and using dynamic libraries, read-only memory mapping, high-resolution counters and performance profiling, task multithreading, and more.
Error Handling in SteerSuite
External errors (for example, an input file has bad syntax, accidental misuse of a class) are handled by throwing a Util::GenericException containing a useful error message. Internal errors use assert statements.
We strongly suggest that you catch exceptions and look at the useful message returned by Util::GenericException::what(). If your code does not handle exceptions, then SteerLib may appear to crash abruptly for no reason, but most likely the error is a simple fix outside of SteerLib, based on the error message contained in the exception. Reading these messages can save you hours of debugging.