It is possible to use Perkun just by instantiating the perkun::optimizer. However this would be not very convenient. The Perkun parser requires an instance of the class perkun::optimizer_with_all_data, which contains:
- perkun::collection_of_values
- perkun::collection_of_variables
- perkun::collection_of_visible_states
- perkun::collection_of_actions
virtual void get_input(std::map<variable*, value*> & m, bool & eof);
virtual void execute(const action * a);
get_input fills the map with the pairs: (variable*,value*) and eventually sets the boolean flag eof, while execute executes the optimal action chosen by the Perkun algorithm. See the Perkun Wars project (http://sourceforge.net/projects/perkunwars/) to learn how these function work in the class npc. They use pipes to communicate with the parent process.
No comments:
Post a Comment