本文整理汇总了C++中ActionSet::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ ActionSet::begin方法的具体用法?C++ ActionSet::begin怎么用?C++ ActionSet::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActionSet
的用法示例。
在下文中一共展示了ActionSet::begin方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
bool Core::check_C2(const ActionSet &le)
{
for (ActionSet::iterator it = ample.begin(); it != ample.end(); it++) {
if (it->type == ActionFire) {
if (verif_configuration.is_visible(*it)) {
if (cfg_debug) {
printf(" C2: %s is visible transition.\n", it->to_string().c_str());
}
return false;
}
}
}
return true;
}
示例2: compute_ample_set
ActionSet Core::compute_ample_set(State *s, const ActionSet &enable)
{
ActionSet::iterator it;
if (cfg_debug) {
// print state name
char *hashstr = (char*) alloca(mhash_get_block_size(MHASH_MD5) * 2 + 1);
hashdigest_to_string(MHASH_MD5, s->compute_hash(MHASH_MD5) , hashstr);
printf(">> state: %s: \nenable: { ", hashstr);
for (it = enable.begin(); it != enable.end(); it++) {
printf("%s ", it->to_string().c_str());
}
printf("}\n");
}
for (it = enable.begin(); it != enable.end(); it++) {
ActionSet ample;
ample.insert(*it);
if (cfg_debug) {
printf(" > ample: { ");
for (ActionSet::iterator i = ample.begin(); i != ample.end(); i++) {
printf("%s ", i->to_string().c_str());
}
printf("}\n");
}
if (check_C1(enable, ample, s) && check_C2(ample) && check_C3(s)) {
if (cfg_debug) {
printf(" This ample set is independent.\n");
}
return ample;
}
if (cfg_wait_for_key) {
getchar();
}
}
return enable;
}
示例3: generate
void Node::generate(Core *core)
{
if (state->get_quit_flag()) {
return;
}
ActionSet enabled = compute_enable_set(core);
ActionSet ws;
if (cfg_partial_order_reduction) {
ws = core->compute_ample_set(state, enabled);
} else {
ws = enabled;
}
State *s;
ActionSet::iterator it;
for (it = ws.begin(); it != ws.end(); it++) {
if (++it != ws.end()) {
s = new State(*state);
} else {
s = state;
}
it--;
switch (it->type) {
case ActionFire:
{
ca::Packer packer;
if (core->generate_binding_in_nni(it->data.fire.transition_def->get_id())) {
s->fire_transition_full_with_binding(it->process, it->data.fire.transition_def, packer);
} else {
s->fire_transition_full(it->process, it->data.fire.transition_def);
}
Node *n = core->add_state(s, this);
NextNodeInfo nninfo;
nninfo.node = n;
nninfo.action = ActionFire;
nninfo.data.fire.process_id = it->process;
nninfo.data.fire.transition_id = it->data.fire.transition_def->get_id();
if (core->generate_binding_in_nni(it->data.fire.transition_def->get_id())) {
nninfo.data.fire.binding = core->hash_packer(packer);
} else {
nninfo.data.fire.binding = NULL;
}
nexts.push_back(nninfo);
packer.free();
break;
}
case ActionReceive:
{
s->receive(it->process, it->data.receive.source, true);
Node *n = core->add_state(s, this);
NextNodeInfo nninfo;
nninfo.node = n;
nninfo.action = ActionReceive;
nninfo.data.receive.process_id = it->process;
nninfo.data.receive.source_id = it->data.receive.source;
nexts.push_back(nninfo);
break;
}
}
}
}