perkun
0.0.9
ExperimentalAIlanguage
|
#include <perkun.h>
Public Member Functions | |
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) |
Public Member Functions inherited from perkun::class_with_tracking | |
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 |
Public Member Functions inherited from perkun::dump_controller | |
void | set_min_report_depth (int d) |
void | set_max_report_depth (int d) |
Protected Member Functions | |
virtual void | on_error_in_populate_belief_for_consequence (const belief &b1, const action &a, const visible_state &vs, belief &target) const |
Protected Member Functions inherited from perkun::action_iteration_controller | |
virtual std::list< action * >::const_iterator | get_action_iteration_begin () |
virtual void | action_iteration_increment (std::list< action * >::const_iterator &target) |
virtual bool | get_action_iteration_terminated (const std::list< action * >::const_iterator &i) |
action_iteration_controller (collection_of_actions &a) | |
Protected Member Functions inherited from perkun::class_with_tracking | |
virtual decision | make_decision (const std::list< tracker * > &s) |
Protected Member Functions inherited from perkun::dump_controller | |
virtual void | dump_belief (std::ostream &s) const =0 |
virtual void | dump_belief_XML (std::ostream &s) const =0 |
virtual std::string | get_stack_file_prefix () const |
virtual std::string | get_iteration_report_file_prefix () const |
virtual std::string | get_belief_file_prefix () const |
void | dump_stack_to_target_stream () |
void | dump_belief_to_target_stream () |
void | dump_iteration_report_to_target_stream () |
Protected Attributes | |
bool | verbose_flag |
Protected Attributes inherited from perkun::action_iteration_controller | |
collection_of_actions & | my_actions |
Protected Attributes inherited from perkun::class_with_tracking | |
std::list< tracker * > | stack_of_trackers |
Protected Attributes inherited from perkun::dump_controller | |
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 |
Private Member Functions | |
float | get_payoff_expected_value_for_consequences (const belief &b1, int n, const action &a) |
Private Attributes | |
collection_of_variables & | my_variables |
collection_of_values & | my_values |
collection_of_visible_states & | my_visible_states |
Additional Inherited Members | |
Protected Types inherited from perkun::class_with_tracking | |
enum | decision { BREAK, CONTINUE, NONE } |
Protected Types inherited from perkun::dump_controller | |
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 } |
This is the central class for the optimization. It is, however, not usable directly by the parser.
float optimizer::get_consequence_probability | ( | const belief & | b1, |
const action & | a, | ||
const visible_state & | vs | ||
) | const |
Calculates the probability of the consequence (visible state).
Returns the optimal action given a belief and n (depth).
|
private |
Returns the expected value of the payoff over the consequences.
|
protectedvirtual |
This function throws an error. It can be overriden to operate more smoothly, for example make the target a uniform belief.
void optimizer::populate_belief_for_consequence | ( | const belief & | b1, |
const action & | a, | ||
const visible_state & | vs, | ||
belief & | target | ||
) | const |
Calculates the belief (probability distribution over a visible state) given a visible state as consequence.