本文整理汇总了C++中Evaluator::End方法的典型用法代码示例。如果您正苦于以下问题:C++ Evaluator::End方法的具体用法?C++ Evaluator::End怎么用?C++ Evaluator::End使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Evaluator
的用法示例。
在下文中一共展示了Evaluator::End方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: run
int SimpleTUI::run(int argc, char *argv[]) {
clock_t main_clock_start = clock();
EvalLog::curr_inst_start_time = get_time_second();
const char *program = (argc > 0) ? argv[0] : "despot";
argc -= (argc > 0);
argv += (argc > 0); // skip program name argv[0] if present
option::Stats stats(usage, argc, argv);
option::Option *options = new option::Option[stats.options_max];
option::Option *buffer = new option::Option[stats.buffer_max];
option::Parser parse(usage, argc, argv, options, buffer);
string solver_type = "DESPOT";
bool search_solver;
/* =========================
* Parse required parameters
* =========================*/
int num_runs = 1;
string simulator_type = "pomdp";
string belief_type = "DEFAULT";
int time_limit = -1;
/* =========================================
* Problem specific default parameter values
*=========================================*/
InitializeDefaultParameters();
/* =========================
* Parse optional parameters
* =========================*/
if (options[E_HELP]) {
cout << "Usage: " << program << " [options]" << endl;
option::printUsage(std::cout, usage);
return 0;
}
OptionParse(options, num_runs, simulator_type, belief_type, time_limit,
solver_type, search_solver);
/* =========================
* Global random generator
* =========================*/
Seeds::root_seed(Globals::config.root_seed);
unsigned world_seed = Seeds::Next();
unsigned seed = Seeds::Next();
Random::RANDOM = Random(seed);
/* =========================
* initialize model
* =========================*/
DSPOMDP *model = InitializeModel(options);
/* =========================
* initialize solver
* =========================*/
Solver *solver = InitializeSolver(model, solver_type, options);
assert(solver != NULL);
/* =========================
* initialize simulator
* =========================*/
Evaluator *simulator = NULL;
InitializeEvaluator(simulator, options, model, solver, num_runs,
main_clock_start, simulator_type, belief_type, time_limit,
solver_type);
simulator->world_seed(world_seed);
int start_run = 0;
/* =========================
* Display parameters
* =========================*/
DisplayParameters(options, model);
/* =========================
* run simulator
* =========================*/
RunEvaluator(model, simulator, options, num_runs, search_solver, solver,
simulator_type, main_clock_start, start_run);
simulator->End();
PrintResult(num_runs, simulator, main_clock_start);
return 0;
}