CYCLUS
Loading...
Searching...
No Matches
xml_file_loader.cc
Go to the documentation of this file.
1// Implements file reader for an XML format
2#include "xml_file_loader.h"
3
4#include <algorithm>
5#include <fstream>
6#include <set>
7#include <streambuf>
8
9#include <boost/filesystem.hpp>
10#include <libxml++/libxml++.h>
11
12#include "agent.h"
13#include "blob.h"
14#include "context.h"
15#include "cyc_std.h"
16#include "discovery.h"
17#include "env.h"
18#include "error.h"
19#include "exchange_solver.h"
21#include "greedy_solver.h"
22#include "infile_tree.h"
23#include "logger.h"
24#include "sim_init.h"
26
27namespace cyclus {
28
29namespace fs = boost::filesystem;
30
31void LoadRawStringstreamFromFile(std::stringstream& stream, std::string file) {
32 std::ifstream file_stream(file.c_str());
33 if (!file_stream) {
34 throw IOError("The file '" + file + "' could not be loaded.");
35 }
36
37 stream << file_stream.rdbuf();
38 file_stream.close();
39}
40
41void LoadStringstreamFromFile(std::stringstream& stream, std::string file, std::string format) {
42 std::string inext;
43 if (format == "none") {
44 LoadRawStringstreamFromFile(stream, file);
45 inext = fs::path(file).extension().string();
46 } else {
47 stream << file;
48 }
49 if (inext == ".json" || format == "json") {
50 std::string inxml = cyclus::toolkit::JsonToXml(stream.str());
51 stream.str(inxml);
52 } else if (inext == ".py" || format == "py") {
53 std::string inxml = cyclus::toolkit::PyToXml(stream.str());
54 stream.str(inxml);
55 }
56}
57
58std::string LoadStringFromFile(std::string file, std::string format) {
59 std::stringstream input;
60 LoadStringstreamFromFile(input, file, format);
61 return input.str();
62}
63
64std::vector<AgentSpec> ParseSpecs(std::set<std::string> agent_set) {
65
66 std::vector<AgentSpec> specs;
67
68 for (const std::string& spec_str : agent_set) {
69 specs.push_back(AgentSpec(spec_str));
70 }
71
72 return specs;
73}
74
75std::vector<AgentSpec> ParseSpecs(std::string infile, std::string format) {
76 std::stringstream input;
77 LoadStringstreamFromFile(input, infile, format);
78 XMLParser parser_;
79 parser_.Init(input);
80 InfileTree xqe(parser_);
81
82 std::set<std::string> unique;
83
84 std::string p = "/simulation/archetypes/spec";
85 int n = xqe.NMatches(p);
86 for (int i = 0; i < n; ++i) {
87 AgentSpec spec(xqe.SubTree(p, i));
88 unique.insert(spec.str());
89 }
90
91 if (unique.size() == 0) {
92 throw ValidationError("failed to parse archetype specs from input file");
93 }
94
95 std::vector<AgentSpec> specs = ParseSpecs(unique);
96
97 return specs;
98}
99
100std::string BuildMasterSchema(std::string schema_path, std::vector<AgentSpec> specs) {
101
102 Timer ti;
103 Recorder rec;
104 Context ctx(&ti, &rec);
105
106 std::stringstream schema("");
107 LoadStringstreamFromFile(schema, schema_path);
108 std::string master = schema.str();
109
110 std::map<std::string, std::string> subschemas;
111
112 // force element types to exist so we always replace the config string
113 subschemas["region"] = "";
114 subschemas["inst"] = "";
115 subschemas["facility"] = "";
116
117 for (int i = 0; i < specs.size(); ++i) {
118 Agent* m = DynamicModule::Make(&ctx, specs[i]);
119 subschemas[m->kind()] += "<element name=\"" + specs[i].alias() + "\">\n";
120 subschemas[m->kind()] += m->schema() + "\n";
121 subschemas[m->kind()] += "</element>\n";
122 ctx.DelAgent(m);
123 }
124
125 // replace refs in master rng template file
126 std::map<std::string, std::string>::iterator it;
127 for (it = subschemas.begin(); it != subschemas.end(); ++it) {
128 std::string search_str = std::string("@") + it->first + std::string("_REFS@");
129 size_t pos = master.find(search_str);
130 if (pos != std::string::npos) {
131 master.replace(pos, search_str.size(), it->second);
132 }
133 }
134
135 return master;
136}
137
138std::string BuildMasterSchema(std::string schema_path) {
139
140 std::vector<AgentSpec> specs = ParseSpecs(cyclus::DiscoverSpecsInCyclusPath());
141
142 return BuildMasterSchema(schema_path, specs);
143
144}
145
146std::string BuildMasterSchema(std::string schema_path, std::string infile, std::string format) {
147
148 std::vector<AgentSpec> specs = ParseSpecs(infile, format);
149
150 return BuildMasterSchema(schema_path, specs);
151
152}
153
155 bool atom_basis;
156 std::string basis_str = qe->GetString("basis");
157 if (basis_str == "atom") {
158 atom_basis = true;
159 } else if (basis_str == "mass") {
160 atom_basis = false;
161 } else {
162 throw IOError(basis_str + " basis is not 'mass' or 'atom'.");
163 }
164
165 double value;
166 int key;
167 std::string query = "nuclide";
168 int nnucs = qe->NMatches(query);
169 CompMap v;
170 for (int i = 0; i < nnucs; i++) {
171 InfileTree* nuclide = qe->SubTree(query, i);
172 key = pyne::nucname::id(nuclide->GetString("id"));
173 value = strtod(nuclide->GetString("comp").c_str(), NULL);
174 v[key] = value;
175 CLOG(LEV_DEBUG3) << " Nuclide: " << key << " Value: " << v[key];
176 }
177
178 if (atom_basis) {
180 } else {
182 }
183}
184
187 std::string schema_file,
188 const std::string input_file,
189 const std::string format, bool ms_print) : b_(b), rec_(r) {
190 ctx_ = new Context(&ti_, rec_);
191
192 schema_path_ = schema_file;
193 file_ = input_file;
194 format_ = format;
195 std::stringstream input;
196 LoadStringstreamFromFile(input, file_, format);
197 parser_ = boost::shared_ptr<XMLParser>(new XMLParser());
198 parser_->Init(input);
199 ms_print_ = ms_print;
200 std::stringstream ss;
201 parser_->Document()->write_to_stream_formatted(ss);
202 ctx_->NewDatum("InputFiles")
203 ->AddVal("Data", Blob(ss.str()))
204 ->Record();
205}
206
210
214
216 std::stringstream ss(master_schema());
217 if(ms_print_){
218 std::cout << master_schema() << std::endl;
219 }
220 parser_->Validate(ss);
221 LoadControlParams(); // must be first
222 LoadSolver();
223 LoadRecipes();
224 LoadPackages();
226 LoadSpecs();
227 LoadInitialAgents(); // must be last
229 rec_->Flush();
230}
231
233 using std::string;
234 InfileTree xqe(*parser_);
235 InfileTree* qe;
236 std::string query = "/*/commodity";
237
238 std::map<std::string, double> commod_priority;
239 std::string name;
240 double priority;
241 int num_commods = xqe.NMatches(query);
242 for (int i = 0; i < num_commods; i++) {
243 qe = xqe.SubTree(query, i);
244 name = qe->GetString("name");
245 priority = OptionalQuery<double>(qe, "solution_priority", -1);
246 commod_priority[name] = priority;
247 }
248
249 ProcessCommodities(&commod_priority);
250 std::map<std::string, double>::iterator it;
251 for (it = commod_priority.begin(); it != commod_priority.end(); ++it) {
252 ctx_->NewDatum("CommodPriority")
253 ->AddVal("Commodity", it->first)
254 ->AddVal("SolutionPriority", it->second)
255 ->Record();
256 }
257
258 // now load the solver info
259 string config = "config";
260 string greedy = "greedy";
261 string coinor = "coin-or";
262 string solver_name = greedy;
263 bool exclusive = ExchangeSolver::kDefaultExclusive;
264 if (xqe.NMatches("/*/control/solver") == 1) {
265 qe = xqe.SubTree("/*/control/solver");
266 if (qe->NMatches(config) == 1) {
267 solver_name = qe->SubTree(config)->GetElementName(0);
268 }
269 exclusive = cyclus::OptionalQuery<bool>(qe, "allow_exclusive_orders",
270 exclusive);
271
272 }
273
274 if (!exclusive) {
275 std::stringstream ss;
276 ss << "You have set allow_exclusive_orders to False."
277 << " Many archetypes (e.g., :cycamore:Reactor) will not work"
278 << " as intended with this feature turned off.";
279 Warn<VALUE_WARNING>(ss.str());
280 }
281
282 ctx_->NewDatum("SolverInfo")
283 ->AddVal("Solver", solver_name)
284 ->AddVal("ExclusiveOrders", exclusive)
285 ->Record();
286
287 // now load the actual solver
288 if (solver_name == greedy) {
289 query = string("/*/control/solver/config/greedy/preconditioner");
290 string precon_name = cyclus::OptionalQuery<string>(&xqe, query, greedy);
291 ctx_->NewDatum("GreedySolverInfo")
292 ->AddVal("Preconditioner", precon_name)
293 ->Record();
294 } else if (solver_name == coinor) {
295 query = string("/*/control/solver/config/coin-or/timeout");
296 double timeout = cyclus::OptionalQuery<double>(&xqe, query, -1);
297 query = string("/*/control/solver/config/coin-or/verbose");
298 bool verbose = cyclus::OptionalQuery<bool>(&xqe, query, false);
299 query = string("/*/control/solver/config/coin-or/mps");
300 bool mps = cyclus::OptionalQuery<bool>(&xqe, query, false);
301 ctx_->NewDatum("CoinSolverInfo")
302 ->AddVal("Timeout", timeout)
303 ->AddVal("Verbose", verbose)
304 ->AddVal("Mps", mps)
305 ->Record();
306 } else {
307 throw ValueError("unknown solver name: " + solver_name);
308 }
309}
310
312 std::map<std::string, double>* commod_priority) {
313 double max = std::max_element(
314 commod_priority->begin(),
315 commod_priority->end(),
316 SecondLT< std::pair<std::string, double> >())->second;
317 if (max < 1) {
318 max = 0; // in case no priorities are specified
319 }
320
321 std::map<std::string, double>::iterator it;
322 for (it = commod_priority->begin();
323 it != commod_priority->end();
324 ++it) {
325 if (it->second < 1) {
326 it->second = max + 1;
327 }
328 CLOG(LEV_INFO1) << "Commodity priority for " << it->first
329 << " is " << it->second;
330 }
331}
332
334 InfileTree xqe(*parser_);
335
336 std::string query = "/*/recipe";
337 int num_recipes = xqe.NMatches(query);
338 for (int i = 0; i < num_recipes; i++) {
339 InfileTree* qe = xqe.SubTree(query, i);
340 std::string name = qe->GetString("name");
341 CLOG(LEV_DEBUG3) << "loading recipe: " << name;
342 Composition::Ptr comp = ReadRecipe(qe);
343 comp->Record(ctx_);
344 ctx_->AddRecipe(name, comp);
345 }
346}
347
349 InfileTree xqe(*parser_);
350
351 ctx_->RecordPackage(Package::unpackaged());
352
353 std::string query = "/*/package";
354 int num_packages = xqe.NMatches(query);
355 for (int i = 0; i < num_packages; i++) {
356 InfileTree* qe = xqe.SubTree(query, i);
357 std::string name = cyclus::OptionalQuery<std::string>(qe, "name", "default");
358 CLOG(LEV_DEBUG3) << "loading package: " << name;
359
360 double fill_min = cyclus::OptionalQuery<double>(qe, "fill_min", eps());
361 double fill_max = cyclus::OptionalQuery<double>(qe, "fill_max", std::numeric_limits<double>::max());
362
363 std::string strategy = cyclus::OptionalQuery<std::string>(qe, "strategy", "first");
364
365 ctx_->AddPackage(name, fill_min, fill_max, strategy);
366 }
367}
368
370 InfileTree xqe(*parser_);
371
372 std::string query = "/*/transportunit";
373 int num_transport_units = xqe.NMatches(query);
374 for (int i = 0; i < num_transport_units; i++) {
375 InfileTree* qe = xqe.SubTree(query, i);
376 std::string name = cyclus::OptionalQuery<std::string>(qe, "name", "default");
377 CLOG(LEV_DEBUG3) << "loading transport unit: " << name;
378
379 double fill_min = cyclus::OptionalQuery<double>(qe, "fill_min", eps());
380 double fill_max = cyclus::OptionalQuery<double>(qe, "fill_max", std::numeric_limits<double>::max());
381
382 std::string strategy = cyclus::OptionalQuery<std::string>(qe, "strategy", "first");
383
384 ctx_->AddTransportUnit(name, fill_min, fill_max, strategy);
385 }
386}
387
389 std::vector<AgentSpec> specs = ParseSpecs(file_, format_);
390 for (int i = 0; i < specs.size(); ++i) {
391 specs_[specs[i].alias()] = specs[i];
392 }
393}
394
396 std::map<std::string, std::string> schema_paths;
397 schema_paths["Region"] = "/*/region";
398 schema_paths["Inst"] = "/*/region/institution";
399 schema_paths["Facility"] = "/*/facility";
400
401 InfileTree xqe(*parser_);
402
403 // create prototypes
404 std::string prototype; // defined here for force-create AgentExit tbl
405 std::map<std::string, std::string>::iterator it;
406 for (it = schema_paths.begin(); it != schema_paths.end(); it++) {
407 int num_agents = xqe.NMatches(it->second);
408 for (int i = 0; i < num_agents; i++) {
409 InfileTree* qe = xqe.SubTree(it->second, i);
410 prototype = qe->GetString("name");
411 std::string alias = qe->SubTree("config")->GetElementName(0);
412 AgentSpec spec = specs_[alias];
413
414 Agent* agent = DynamicModule::Make(ctx_, spec);
415
416 // call manually without agent impl injected to keep all Agent state in a
417 // single, consolidated db table
418 agent->Agent::InfileToDb(qe, DbInit(agent, true));
419
420 agent->InfileToDb(qe, DbInit(agent));
421 rec_->Flush();
422
423 std::vector<Cond> conds;
424 conds.push_back(Cond("SimId", "==", rec_->sim_id()));
425 conds.push_back(Cond("SimTime", "==", static_cast<int>(0)));
426 conds.push_back(Cond("AgentId", "==", agent->id()));
427 CondInjector ci(b_, conds);
428 PrefixInjector pi(&ci, "AgentState");
429
430 // call manually without agent impl injected
431 agent->Agent::InitFrom(&pi);
432
433 pi = PrefixInjector(&ci, "AgentState" + spec.Sanitize());
434 agent->InitFrom(&pi);
435 ctx_->AddPrototype(prototype, agent);
436 }
437 }
438
439 // build initial agent instances
440 int nregions = xqe.NMatches(schema_paths["Region"]);
441 for (int i = 0; i < nregions; ++i) {
442 InfileTree* qe = xqe.SubTree(schema_paths["Region"], i);
443 std::string region_proto = qe->GetString("name");
444 Agent* reg = BuildAgent(region_proto, NULL);
445
446 int ninsts = qe->NMatches("institution");
447 for (int j = 0; j < ninsts; ++j) {
448 InfileTree* qe2 = qe->SubTree("institution", j);
449 std::string inst_proto = qe2->GetString("name");
450 Agent* inst = BuildAgent(inst_proto, reg);
451
452 int nfac = qe2->NMatches("initialfacilitylist/entry");
453 for (int k = 0; k < nfac; ++k) {
454 InfileTree* qe3 = qe2->SubTree("initialfacilitylist/entry", k);
455 std::string fac_proto = qe3->GetString("prototype");
456
457 int number = atoi(qe3->GetString("number").c_str());
458 for (int z = 0; z < number; ++z) {
459 Agent* fac = BuildAgent(fac_proto, inst);
460 }
461 }
462 }
463 }
464}
465
466Agent* XMLFileLoader::BuildAgent(std::string proto, Agent* parent) {
467 Agent* m = ctx_->CreateAgent<Agent>(proto);
468 m->Build(parent);
469 if (parent != NULL) {
470 parent->BuildNotify(m);
471 }
472 return m;
473}
474
476 InfileTree xqe(*parser_);
477 std::string query = "/*/control";
478 InfileTree* qe = xqe.SubTree(query);
479
480 std::string handle;
481 if (qe->NMatches("simhandle") > 0) {
482 handle = qe->GetString("simhandle");
483 }
484
485 // get duration
486 std::string dur_str = qe->GetString("duration");
487 int dur = strtol(dur_str.c_str(), NULL, 10);
488 // get start month
489 std::string m0_str = qe->GetString("startmonth");
490 int m0 = strtol(m0_str.c_str(), NULL, 10);
491 // get start year
492 std::string y0_str = qe->GetString("startyear");
493 int y0 = strtol(y0_str.c_str(), NULL, 10);
494 // get decay mode
495 std::string d = OptionalQuery<std::string>(qe, "decay", "manual");
496
497 SimInfo si(dur, y0, m0, handle, d);
498
499 si.explicit_inventory = OptionalQuery<bool>(qe, "explicit_inventory", false);
500 si.explicit_inventory_compact = OptionalQuery<bool>(qe, "explicit_inventory_compact", false);
501
502 // get time step duration
504
505 // get epsilon
506 double eps_ = OptionalQuery<double>(qe, "tolerance_generic", 1e-6);
507 cy_eps = si.eps = eps_;
508
509 // get epsilon resources
510 double eps_rsrc_ = OptionalQuery<double>(qe, "tolerance_resource", 1e-6);
511 cy_eps_rsrc = si.eps_rsrc = eps_rsrc_;
512
513 // get seed
514 si.seed = OptionalQuery<int>(qe, "seed", kDefaultSeed);
515
516 // get stride
517 si.stride = OptionalQuery<int>(qe, "stride", kDefaultStride);
518
519 ctx_->InitSim(si);
520}
521
522} // namespace cyclus
std::string Sanitize()
std::string str()
The abstract base class used by all types of agents that live and interact in a simulation.
Definition agent.h:49
virtual void InitFrom(QueryableBackend *b)
Intializes an agent's internal state from the database.
Definition agent.cc:45
virtual void Build(Agent *parent)
Called when the agent enters the smiulation as an active participant and is only ever called once.
Definition agent.cc:153
virtual std::string schema()
Returns an agent's xml rng schema for initializing from input files.
Definition agent.h:333
virtual void InfileToDb(InfileTree *qe, DbInit di)
Translates info for the agent from an input file to the database by reading parameters from the passe...
Definition agent.cc:36
const std::string kind() const
Returns a string that describes the agent subclass (e.g.
Definition agent.h:364
virtual const int id() const
The agent instance's unique ID within a simulation.
Definition agent.h:352
A type to represent variable-length array of bytes for dumping to a cyclus output database.
Definition blob.h:9
static Ptr CreateFromMass(CompMap v)
Creates a new composition from v with its components having appropriate mass-based ratios.
boost::shared_ptr< Composition > Ptr
Definition composition.h:43
static Ptr CreateFromAtom(CompMap v)
Creates a new composition from v with its components having appropriate atom-based ratios.
Wrapper class for QueryableBackends that injects a set of Cond's into every query before being execut...
Represents a condition used to filter rows returned by a query.
A simulation context provides access to necessary simulation-global functions and state.
Definition context.h:145
void DelAgent(Agent *m)
Destructs and cleans up m (and it's children recursively).
Definition context.cc:115
DbInit provides an interface for agents to record data to the output db that automatically injects th...
Definition db_init.h:14
static Agent * Make(Context *ctx, AgentSpec spec)
Returns a newly constructed agent for the given module spec.
static const bool kDefaultExclusive
default value to allow exclusive orders or not
for failed reading/writing to files, network connections, etc..
Definition error.h:59
A class for extracting information from a given XML parser.
Definition infile_tree.h:22
virtual int NMatches(std::string query)
investigates the current status and returns the number of elements matching a query
virtual std::string GetElementName(int index=0)
investigates the current status and returns a string representing the name of a given index
InfileTree * SubTree(std::string query, int index=0)
populates a child infile based on a query and index
virtual std::string GetString(std::string query, int index=0)
investigates the current status and returns a string representing the content of a query at a given i...
static Ptr & unpackaged()
Definition package.cc:24
Wrapper class for QueryableBackends that injects prefix in front of the title/table for every query b...
Interface implemented by backends that support rudimentary querying.
Collects and manages output data generation for the cyclus core and agents during a simulation.
Definition recorder.h:45
Container for a static simulation-global parameters that both describe the simulation and affect its ...
Definition context.h:45
double eps_rsrc
Epsilon for resources in the simulation.
Definition context.h:113
bool explicit_inventory_compact
True if per-agent inventories should be explicitly queried/recorded every time step in a table (i....
Definition context.h:122
double eps
Epsilon in the simulation.
Definition context.h:110
uint64_t stride
Stride length.
Definition context.h:131
uint64_t dt
Duration in seconds of a single time step in the simulation.
Definition context.h:107
uint64_t seed
Seed for random number generator.
Definition context.h:125
bool explicit_inventory
True if per-agent inventories should be explicitly queried/recorded every time step in a table (i....
Definition context.h:117
static void Snapshot(Context *ctx)
Records a snapshot of the current state of the simulation being managed by ctx into the simulation's ...
Definition sim_init.cc:76
Controls simulation timestepping and inter-timestep phases.
Definition timer.h:22
For validating files received via IO.
Definition error.h:71
For values that are too big, too small, etc.
Definition error.h:41
XMLFileLoader(Recorder *r, QueryableBackend *b, std::string schema_file, const std::string input_file="", const std::string format="none", bool ms_print=false)
Create a new loader reading from the xml simulation input file and writing to and initializing the ba...
void LoadPackages()
Loads packages.
void LoadRecipes()
Method to load recipes from either the primary input file or a recipeBook catalog.
std::string format_
the input file format
void LoadControlParams()
Method to load the simulation control parameters.
boost::shared_ptr< XMLParser > parser_
the parser
void LoadSolver()
Method to load the simulation exchange solver.
void LoadSpecs()
Load agent specs from the input file to a map by alias.
bool ms_print_
flag to indicate printing master schema
virtual std::string master_schema()
QueryableBackend * b_
std::string schema_path_
filepath to the schema
void LoadTransportUnits()
Loads Transport Units.
std::map< std::string, AgentSpec > specs_
virtual void LoadInitialAgents()
Creates all initial agent instances from the input file.
Agent * BuildAgent(std::string proto, Agent *parent)
Creates and builds an agent, notifying its parent.
void ProcessCommodities(std::map< std::string, double > *commodity_priority)
Processes commodity priorities, such that any without a defined priority (i.e., are nonpositive),...
std::string file_
the input file name
virtual void LoadSim()
Load an entire simulation from the inputfile.
A helper class to hold xml file data and provide automatic validation.
Definition xml_parser.h:15
void Init(const std::stringstream &input)
initializes a parser with an xml snippet
Definition xml_parser.cc:49
const uint64_t kDefaultSeed
Definition context.h:25
const uint64_t kDefaultStride
Definition context.h:27
const uint64_t kDefaultTimeStepDur
Definition context.h:23
Code providing rudimentary logging capability for the Cyclus core.
#define CLOG(level)
Definition logger.h:39
std::string JsonToXml(std::string s)
Converts a JSON string into an equivalent XML string.
std::string PyToXml(std::string s)
Converts a Python string into an equivalent XML string.
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or....
Definition agent.cc:14
void LoadRawStringstreamFromFile(std::stringstream &stream, std::string file)
Reads the given file path into the passed stream without modification.
std::set< std::string > DiscoverSpecsInCyclusPath()
Discover archetype specifications that live recursively in CYCLUS_PATH directories.
Definition discovery.cc:130
Composition::Ptr ReadRecipe(InfileTree *qe)
Creates a composition from the recipe in the query engine.
double cy_eps_rsrc
epsilon values to be used by resources
Definition context.cc:22
double cy_eps
generic epsilon values
Definition context.cc:21
void LoadStringstreamFromFile(std::stringstream &stream, std::string file, std::string format)
Reads the given file path as XML into the passed stream.
std::vector< AgentSpec > ParseSpecs(std::set< std::string > agent_set)
Returns a list of the full module+agent spec for all agents in the given set of agent names.
@ LEV_DEBUG3
debugging information
Definition logger.h:60
@ LEV_INFO1
Information helpful for simulation users and developers alike - least verbose.
Definition logger.h:53
std::map< Nuc, double > CompMap
a raw definition of nuclides and corresponding (dimensionless quantities).
Definition composition.h:17
std::string LoadStringFromFile(std::string file, std::string format)
Reads the given file path and returns an XML string.
double eps()
a generic epsilon value
Definition cyc_limits.h:12
std::string BuildMasterSchema(std::string schema_path, std::vector< AgentSpec > specs)
Builds and returns a master cyclus input xml schema that includes the sub-schemas defined by the prov...
T OptionalQuery(InfileTree *tree, std::string query, T default_val)
a query method for optional parameters
void Warn(const std::string &msg)
Issue a warning with the approriate message, accoring to the current warning settings.
Definition error.h:115
int id(int nuc)
Definition pyne.cc:2716
a less-than comparison for pairs
Definition cyc_std.h:12