|
void | declare_values () |
|
void | declare_variables_values () |
|
void | add_value (const char *s) |
|
void | create_input_variable (const char *s) |
|
void | create_hidden_variable (const char *s) |
|
void | create_output_variable (const char *s) |
|
void | make_model () |
|
void | test_model () const |
|
void | clear_query () |
|
void | assert_query_fact (const char *v, const char *val) |
|
int | parse (const char *filename) |
|
virtual void | set_apriori_belief (belief *b) const |
|
virtual void | print_initial_loop_message () const |
|
virtual void | print_current_belief () |
|
virtual void | get_input (std::map< variable *, value * > &m, bool &eof) |
|
virtual void | execute (const action *a) |
|
| optimizer (collection_of_variables &v, collection_of_values &w, collection_of_visible_states &vs, collection_of_actions &a) |
|
float | get_consequence_probability (const belief &b1, const action &a, const visible_state &vs) const |
|
void | populate_belief_for_consequence (const belief &b1, const action &a, const visible_state &vs, belief &target) const |
|
const action * | get_optimal_action (const belief &b, int n) |
|
virtual void | dump_stack (std::ostream &s) const |
|
virtual void | dump_stack_XML (std::ostream &s) const |
|
virtual void | dump_iteration_report (std::ostream &s) const |
|
virtual void | dump_iteration_report_XML (std::ostream &s) const |
|
void | set_min_report_depth (int d) |
|
void | set_max_report_depth (int d) |
|
|
enum | decision { BREAK,
CONTINUE,
NONE
} |
|
enum | target_type { COUT = 0x1,
CERR = 0x2,
SINGLE_FILE = 0x4,
ITERATED_FILES = 0x8
} |
|
enum | dump_stack_mode_type { dump_stack_as_XML,
dump_stack_as_text
} |
|
enum | dump_belief_mode_type { dump_belief_as_XML,
dump_belief_as_text
} |
|
enum | dump_iteration_report_mode_type { dump_iteration_report_as_XML,
dump_iteration_report_as_text
} |
|
bool | verbose_flag |
|
collection_of_actions & | my_actions |
|
std::list< tracker * > | stack_of_trackers |
|
dump_stack_mode_type | dump_stack_mode |
|
dump_belief_mode_type | dump_belief_mode |
|
dump_iteration_report_mode_type | dump_iteration_report_mode |
|
target_type | dump_stack_target |
|
target_type | dump_belief_target |
|
target_type | dump_iteration_report_target |
|
int | min_report_depth |
|
int | max_report_depth |
|
int | stack_file_counter |
|
int | belief_file_counter |
|
int | iteration_report_file_counter |
|
This is an optimizer containing all the collections internally. In addition it has some methods used by the parser to configure it.
Since the version 0.0.3 perkun is a library, this is the main class to inherit from. The virtual functions can be redefined to control the input and optimal action execution.
You can either use a Perkun code with a "loop" command, then you will probably want to fork and inherit this class with redefinition of the functions "get_input" and "execute". Then you may use the pipes to write/read the data to/from perkun.
Otherwise you may just parse a Perkun code without a "loop" command and implement something similar after the Perkun code is parsed. See the file perkun_c.cc, function perkun_loop to understand the algorithm. The optimizer_with_all_data will contain all the values, variables, actions and visible states after the parse function returns (provided it was succesfull).
Otherwise you may ignore the parser completely and instantiate your own optimizer. It requires the instances of the following collections: values, variables, actions and visible states. All of them need to be configured directly using methods (but then you can forget the Perkun parser).