next up previous contents
Next: Related Work Up: The FLOKK Library Previous: Motion Flokk   Contents

Problem

A problem causes an agent to behave in a manner in which the problem is solved. The problem could be that the agent needs to move to a certain position. Then the agent solves the problem by getting to that position. Various other problems can be defined which may result in movement or yield some other result.

The idea is to make the flokk behave how the programmer wants. So the programmer defines problems and how to solve them. Problems may be given to an agent in one of three ways: the flokk assigns a problem to one/many of its agents, an agent asks the flokk for any available problems to solve, or the agent generates new problems as it tries to solve the current problem. A problem, when given to an agent, performs the solving with the agent following the instructions from the solver.

As mentioned earlier, the programmer subclasses Problem from the FLOKK library. The programmer overrides the solve( float dt ), reset( ), and isSolved( ) methods. In solve( float dt ), the programmer defines how the object solves the problem. It takes a float dt representing the change in time since the last update. The reset( ) function resets the problem back to being unsolved.


next up previous contents
Next: Related Work Up: The FLOKK Library Previous: Motion Flokk   Contents
Stuart Tett 2004-12-10