本文整理汇总了C++中StateType::getState方法的典型用法代码示例。如果您正苦于以下问题:C++ StateType::getState方法的具体用法?C++ StateType::getState怎么用?C++ StateType::getState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StateType
的用法示例。
在下文中一共展示了StateType::getState方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: local_run_l
virtual stats local_run_l(int index, bool learn) {
DAction* ac = fac;
double total_reward = 0;
DAction* b = new DAction(prob->getActions(), (int) false );
do
{
prob->apply(*ac);
total_reward += prob->reward();
if(learn) {
if(!prob->restrictedAction().restricted)
ac = this->computeNextAction(getState(prob), prob->reward(), prob->goal());
else {
agent->had_choosed(getState(prob), *b, prob->reward(), false, prob->goal());
ac = b;
}
// ac = this->computeNextAction(getState(prob), prob->reward(), prob->goal());
}
else {
if(ac != fac)
delete ac;
ac = this->agent->decision(getState(prob), false);
}
}
while(!prob->done());
if(!learn)
delete ac;
delete b;
return {prob->step, total_reward, prob->step, index};
}
示例2: local_run
stats local_run(int index, bool random_init) {
prob->init(random_init);
agent->startEpisode(getState(prob), *fac);
// if(no_learn_knowledge) {
local_run_l(index, true);
prob->init(random_init);
agent->startEpisode(getState(prob), *fac);
return local_run_l(index, false);
// }
// return local_run_l(index, true);
}
示例3: run_best
stats run_best(int index) {
prob->init(false);
DAction* ac = new DAction(*fac);
double total_reward = 0;
do
{
prob->apply(*ac);
delete ac;
total_reward += prob->reward();
ac = best_policy->decision(getState(prob), false);
}
while(!prob->done());
delete ac;
return {prob->step, total_reward, prob->step, index};
}
示例4: init
void init() {
agent = this->createAgent(getState(prob), *fac);
agentSet = true;
}