Skip to content
Snippets Groups Projects
Commit 6bbc03e0 authored by Franck Dary's avatar Franck Dary
Browse files

More debug info for dynamical oracle

parent 1c781b93
Branches
No related tags found
No related merge requests found
...@@ -150,6 +150,7 @@ void Trainer::train() ...@@ -150,6 +150,7 @@ void Trainer::train()
fprintf(stderr, "ERROR (%s) : Unable to find any zero cost action. Aborting.\n", ERRINFO); fprintf(stderr, "ERROR (%s) : Unable to find any zero cost action. Aborting.\n", ERRINFO);
fprintf(stderr, "State : %s\n", currentState->name.c_str()); fprintf(stderr, "State : %s\n", currentState->name.c_str());
trainConfig.printForDebug(stderr); trainConfig.printForDebug(stderr);
classifier->explainCostOfActions(stderr, trainConfig);
exit(1); exit(1);
} }
......
...@@ -106,6 +106,11 @@ class Classifier ...@@ -106,6 +106,11 @@ class Classifier
/// ///
/// @return A vector of all the actions that are zero cost given this Config. /// @return A vector of all the actions that are zero cost given this Config.
std::vector<std::string> getZeroCostActions(Config & config); std::vector<std::string> getZeroCostActions(Config & config);
/// @brief Print an explaination as of why some actions are not zero cost.
///
/// @param output Where to write the explainations.
/// @param config The current Config.
void explainCostOfActions(FILE * output, Config & config);
/// @brief Use the Oracle on the config to get the correct Action to take. /// @brief Use the Oracle on the config to get the correct Action to take.
/// ///
/// @param config The Config to work with. /// @param config The Config to work with.
......
...@@ -77,6 +77,12 @@ class Oracle ...@@ -77,6 +77,12 @@ class Oracle
/// ///
/// @return Whether or not the action is optimal for the given Config. /// @return Whether or not the action is optimal for the given Config.
bool actionIsZeroCost(Config & config, const std::string & action); bool actionIsZeroCost(Config & config, const std::string & action);
/// @brief Explain why an action is zero cost or not.
///
/// @param output Where to write the explaination.
/// @param config The current Config.
/// @param action The current Action.
void explainCostOfAction(FILE * output, Config & config, const std::string & action);
/// @brief Get the optimal action given the current Config, only for non-trainable Classifier.. /// @brief Get the optimal action given the current Config, only for non-trainable Classifier..
/// ///
/// @param config The current Config. /// @param config The current Config.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment