46 out0 << message <<
'\n';
68 const TokVal& keywordvalue)
70 extern const map<String, Index>
MdMap;
72 const map<String, Index>::const_iterator i2 =
MdMap.find(methodname);
73 assert ( i2 !=
MdMap.end() );
74 Index id = i2->second;
96 extern const map<String, Index>
AgendaMap;
101 map<String, Index>::const_iterator mi =
117 Index this_wsv = this_data.
Out()[i];
122 os <<
"The agenda " <<
mname
123 <<
" must generate the output WSV "
125 <<
"but it does not. It only generates:\n";
129 throw runtime_error (os.str());
138 Index this_wsv = this_data.
In()[i];
143 os <<
"The agenda " <<
mname
144 <<
" must use the input WSV "
146 <<
"but it does not. It only uses:\n";
150 throw runtime_error (os.str());
172 os <<
"Agenda *" <<
mname <<
"* hasn't been checked for consistency yet."
174 <<
"This check is usually done by AgendaSet or AgendaAppend."
176 <<
"However, if you have written code that modifies an Agenda directly"
178 <<
"(changing its name or altering its method list), it's up to you to"
180 <<
"call Agenda::check after your modifications.";
181 throw runtime_error(os.str());
185 assert (
mname !=
"");
206 aout1 <<
"Executing " <<
name() <<
"\n"
224 if ((mdd.
SetMethod() && mrr.Out().nelem()
227 || (mdd.
Name() ==
"Delete" && mrr.In().
nelem()
234 out3 <<
"- " << mdd.
Name() <<
"\n";
241 out1 <<
"- " << mdd.
Name() <<
"\n";
250 give_up(
"Method "+mdd.
Name()+
" needs input variable: "+
259 give_up(
"Method "+mdd.
Name()+
" needs input variable: "+
267 catch (runtime_error x)
272 os <<
"Run-time error in method: " << mdd.
Name() <<
'\n'
275 throw runtime_error(os.str());
297 set<Index> outs2push;
301 method !=
mml.end (); method++)
310 souts.insert ( outs.begin (), outs.end ());
311 souts.insert ( gouts.begin (), gouts.end ());
315 inputs.insert (gins.begin (), gins.end ());
321 if (
md_data[method->Id()].Name() ==
"Delete")
323 souts.insert ( gins.begin (), gins.end ());
328 inputs.insert (ins.begin (), ins.end ());
331 outputs.insert (souts.begin (), souts.end ());
336 set_intersection (souts.begin (), souts.end (),
337 inputs.begin (), inputs.end (),
338 insert_iterator< set<Index> >(outs2dup,
344 set_difference (outputs.begin (), outputs.end (),
345 outs2dup.begin (), outs2dup.end (),
346 insert_iterator< set<Index> >(outs2push,
347 outs2push.begin ()));
349 extern const map<String, Index>
AgendaMap;
361 saout.insert ( aout.begin (), aout.end ());
362 sain.insert ( ain.begin (), ain.end ());
370 set<Index> outs2push_without_agenda_input;
371 set_difference (outs2push.begin (), outs2push.end (),
372 sain.begin (), sain.end (),
373 insert_iterator< set<Index> >(outs2push_without_agenda_input,
374 outs2push_without_agenda_input.begin ()));
377 set_difference (outs2push_without_agenda_input.begin (),
378 outs2push_without_agenda_input.end (),
379 saout.begin (), saout.end (),
386 set<Index> outs2dup_without_agenda_input;
387 set_difference (outs2dup.begin (), outs2dup.end (),
388 sain.begin (), sain.end (),
389 insert_iterator< set<Index> >(outs2dup_without_agenda_input,
390 outs2dup_without_agenda_input.begin ()));
393 set_difference (outs2dup_without_agenda_input.begin (),
394 outs2dup_without_agenda_input.end (),
395 saout.begin (), saout.end (),
403 set<Index> saout_only;
405 set_difference (saout.begin (), saout.end (),
406 sain.begin (), sain.end (),
407 insert_iterator< set<Index> >(saout_only,
408 saout_only.begin ()));
411 set_intersection (outs2dup.begin (), outs2dup.end (),
412 saout_only.begin (), saout_only.end (),
413 insert_iterator<ArrayOfIndex>(agenda_only_out_wsm_in,
414 agenda_only_out_wsm_in.begin ()));
420 set<Index> sain_only;
422 set_difference (sain.begin (), sain.end (),
423 saout.begin (), saout.end (),
424 insert_iterator< set<Index> >(sain_only,
425 sain_only.begin ()));
428 set_intersection (outs2push.begin (), outs2push.end (),
429 sain_only.begin (), sain_only.end (),
430 insert_iterator<ArrayOfIndex>(agenda_only_in_wsm_out,
431 agenda_only_in_wsm_out.begin ()));
435 out3 <<
" [Agenda::pushpop] : " <<
name() <<
"\n";
436 out3 <<
" [Agenda::pushpop] - # Funcs in Ag : " <<
mml.
nelem () <<
"\n";
437 out3 <<
" [Agenda::pushpop] - AgOut : ";
440 out3 <<
" [Agenda::pushpop] - AgIn : ";
443 out3 <<
" [Agenda::pushpop] - All WSM output: ";
446 out3 <<
" [Agenda::pushpop] - WSVs push : ";
449 out3 <<
" [Agenda::pushpop] - WSVs dup : ";
452 out3 <<
" [Agenda::pushpop] - Ag inp dup : ";
455 out3 <<
" [Agenda::pushpop] - Ag out dup : ";
459 if (agenda_only_in_wsm_out.
nelem ())
462 err <<
"At least one variable is only defined as input\n"
463 <<
"in agenda " <<
name () <<
", but\n"
464 <<
"used as output in a WSM called by the agenda!!!\n"
465 <<
"This is not allowed.\n"
468 throw runtime_error (err.str ());
493 Index WsvAgendaGroupIndex = 0;
497 WsvAgendaGroupIndex = i;
513 if ( var == input[j] )
return true;
524 if ( var == input[j] )
return true;
530 for (
Index j = 0; j <
md_data[this_method.
Id ()].GInType().nelem(); j++)
532 if (
md_data[this_method.
Id ()].GInType()[j] == WsvAgendaGroupIndex)
534 Agenda *AgendaFromGeneralInput =
537 if ((*AgendaFromGeneralInput).is_input(ws, var))
576 if ( var == output[j] )
return true;
587 if ( var == output[j] )
return true;
631 cout <<
md_data[mr->Id()].Name() <<
": ";
632 cout << mr->In() << endl;
634 if (
md_data[mr->Id()].Name() ==
"AgendaExecute")
636 cout <<
"AgendaExecute" << endl;
640 for (ArrayOfIndex::const_iterator it = mr->In().begin();
641 it != mr->In().end(); it++)
642 if (find (in_vars.begin(), in_vars.end(), *it) == in_vars.end())
643 in_vars.push_back (*it);
645 for (ArrayOfIndex::const_iterator it = mr->Out().begin();
646 it != mr->Out().end(); it++)
647 if (find( out_vars.begin(), out_vars.end(), *it) == out_vars.end())
648 out_vars.push_back (*it);
651 while (mr !=
mml.begin());
653 cout <<
"In : " << in_vars << endl;
654 cout <<
"Out: " << out_vars << endl;
670 const String& indent )
const
675 mml[i].print(os,indent);
724 const String& indent )
const
731 os << indent << tmd.
Name();
743 if (first) first=
false;
751 if (first) first=
false;
762 if ( 0 !=
Tasks().nelem() )