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 "env.h"
17#include "error.h"
18#include "exchange_solver.h"
20#include "greedy_solver.h"
21#include "infile_tree.h"
22#include "logger.h"
23#include "sim_init.h"
25
26namespace cyclus {
27
28namespace fs = boost::filesystem;
29
30void LoadRawStringstreamFromFile(std::stringstream& stream, std::string file) {
31 std::ifstream file_stream(file.c_str());
32 if (!file_stream) {
33 throw IOError("The file '" + file + "' could not be loaded.");
34 }
35
36 stream << file_stream.rdbuf();
37 file_stream.close();
38}
39
40void LoadStringstreamFromFile(std::stringstream& stream, std::string file, std::string format) {
41 std::string inext;
42 if (format == "none") {
43 LoadRawStringstreamFromFile(stream, file);
44 inext = fs::path(file).extension().string();
45 } else {
46 stream << file;
47 }
48 if (inext == ".json" || format == "json") {
49 std::string inxml = cyclus::toolkit::JsonToXml(stream.str());
50 stream.str(inxml);
51 } else if (inext == ".py" || format == "py") {
52 std::string inxml = cyclus::toolkit::PyToXml(stream.str());
53 stream.str(inxml);
54 }
55}
56
57std::string LoadStringFromFile(std::string file, std::string format) {
58 std::stringstream input;
59 LoadStringstreamFromFile(input, file, format);
60 return input.str();
61}
62
63std::vector<AgentSpec> ParseSpecs(std::string infile, std::string format) {
64 std::stringstream input;
65 LoadStringstreamFromFile(input, infile, format);
66 XMLParser parser_;
67 parser_.Init(input);
68 InfileTree xqe(parser_);
69
70 std::vector<AgentSpec> specs;
71 std::set<std::string> unique;
72
73 std::string p = "/simulation/archetypes/spec";
74 int n = xqe.NMatches(p);
75 for (int i = 0; i < n; ++i) {
76 AgentSpec spec(xqe.SubTree(p, i));
77 if (unique.count(spec.str()) == 0) {
78 specs.push_back(spec);
79 unique.insert(spec.str());
80 }
81 }
82
83 if (specs.size() == 0) {
84 throw ValidationError("failed to parse archetype specs from input file");
85 }
86
87 return specs;
88}
89
90std::string BuildMasterSchema(std::string schema_path, std::string infile, std::string format) {
91 Timer ti;
92 Recorder rec;
93 Context ctx(&ti, &rec);
94
95 std::stringstream schema("");
96 LoadStringstreamFromFile(schema, schema_path);
97 std::string master = schema.str();
98
99 std::vector<AgentSpec> specs = ParseSpecs(infile, format);
100
101 std::map<std::string, std::string> subschemas;
102
103 // force element types to exist so we always replace the config string
104 subschemas["region"] = "";
105 subschemas["inst"] = "";
106 subschemas["facility"] = "";
107
108 for (int i = 0; i < specs.size(); ++i) {
109 Agent* m = DynamicModule::Make(&ctx, specs[i]);
110 subschemas[m->kind()] += "<element name=\"" + specs[i].alias() + "\">\n";
111 subschemas[m->kind()] += m->schema() + "\n";
112 subschemas[m->kind()] += "</element>\n";
113 ctx.DelAgent(m);
114 }
115
116 // replace refs in master rng template file
117 std::map<std::string, std::string>::iterator it;
118 for (it = subschemas.begin(); it != subschemas.end(); ++it) {
119 std::string search_str = std::string("@") + it->first + std::string("_REFS@");
120 size_t pos = master.find(search_str);
121 if (pos != std::string::npos) {
122 master.replace(pos, search_str.size(), it->second);
123 }
124 }
125
126 return master;
127}
128
130 bool atom_basis;
131 std::string basis_str = qe->GetString("basis");
132 if (basis_str == "atom") {
133 atom_basis = true;
134 } else if (basis_str == "mass") {
135 atom_basis = false;
136 } else {
137 throw IOError(basis_str + " basis is not 'mass' or 'atom'.");
138 }
139
140 double value;
141 int key;
142 std::string query = "nuclide";
143 int nnucs = qe->NMatches(query);
144 CompMap v;
145 for (int i = 0; i < nnucs; i++) {
146 InfileTree* nuclide = qe->SubTree(query, i);
147 key = pyne::nucname::id(nuclide->GetString("id"));
148 value = strtod(nuclide->GetString("comp").c_str(), NULL);
149 v[key] = value;
150 CLOG(LEV_DEBUG3) << " Nuclide: " << key << " Value: " << v[key];
151 }
152
153 if (atom_basis) {
155 } else {
157 }
158}
159
162 std::string schema_file,
163 const std::string input_file,
164 const std::string format, bool ms_print) : b_(b), rec_(r) {
165 ctx_ = new Context(&ti_, rec_);
166
167 schema_path_ = schema_file;
168 file_ = input_file;
169 format_ = format;
170 std::stringstream input;
171 LoadStringstreamFromFile(input, file_, format);
172 parser_ = boost::shared_ptr<XMLParser>(new XMLParser());
173 parser_->Init(input);
174 ms_print_ = ms_print;
175 std::stringstream ss;
176 parser_->Document()->write_to_stream_formatted(ss);
177 ctx_->NewDatum("InputFiles")
178 ->AddVal("Data", Blob(ss.str()))
179 ->Record();
180}
181
185
189
191 std::stringstream ss(master_schema());
192 if(ms_print_){
193 std::cout << master_schema() << std::endl;
194 }
195 parser_->Validate(ss);
196 LoadControlParams(); // must be first
197 LoadSolver();
198 LoadRecipes();
199 LoadPackages();
201 LoadSpecs();
202 LoadInitialAgents(); // must be last
204 rec_->Flush();
205}
206
208 using std::string;
209 InfileTree xqe(*parser_);
210 InfileTree* qe;
211 std::string query = "/*/commodity";
212
213 std::map<std::string, double> commod_priority;
214 std::string name;
215 double priority;
216 int num_commods = xqe.NMatches(query);
217 for (int i = 0; i < num_commods; i++) {
218 qe = xqe.SubTree(query, i);
219 name = qe->GetString("name");
220 priority = OptionalQuery<double>(qe, "solution_priority", -1);
221 commod_priority[name] = priority;
222 }
223
224 ProcessCommodities(&commod_priority);
225 std::map<std::string, double>::iterator it;
226 for (it = commod_priority.begin(); it != commod_priority.end(); ++it) {
227 ctx_->NewDatum("CommodPriority")
228 ->AddVal("Commodity", it->first)
229 ->AddVal("SolutionPriority", it->second)
230 ->Record();
231 }
232
233 // now load the solver info
234 string config = "config";
235 string greedy = "greedy";
236 string coinor = "coin-or";
237 string solver_name = greedy;
238 bool exclusive = ExchangeSolver::kDefaultExclusive;
239 if (xqe.NMatches("/*/control/solver") == 1) {
240 qe = xqe.SubTree("/*/control/solver");
241 if (qe->NMatches(config) == 1) {
242 solver_name = qe->SubTree(config)->GetElementName(0);
243 }
244 exclusive = cyclus::OptionalQuery<bool>(qe, "allow_exclusive_orders",
245 exclusive);
246
247 }
248
249 if (!exclusive) {
250 std::stringstream ss;
251 ss << "You have set allow_exclusive_orders to False."
252 << " Many archetypes (e.g., :cycamore:Reactor) will not work"
253 << " as intended with this feature turned off.";
254 Warn<VALUE_WARNING>(ss.str());
255 }
256
257 ctx_->NewDatum("SolverInfo")
258 ->AddVal("Solver", solver_name)
259 ->AddVal("ExclusiveOrders", exclusive)
260 ->Record();
261
262 // now load the actual solver
263 if (solver_name == greedy) {
264 query = string("/*/control/solver/config/greedy/preconditioner");
265 string precon_name = cyclus::OptionalQuery<string>(&xqe, query, greedy);
266 ctx_->NewDatum("GreedySolverInfo")
267 ->AddVal("Preconditioner", precon_name)
268 ->Record();
269 } else if (solver_name == coinor) {
270 query = string("/*/control/solver/config/coin-or/timeout");
271 double timeout = cyclus::OptionalQuery<double>(&xqe, query, -1);
272 query = string("/*/control/solver/config/coin-or/verbose");
273 bool verbose = cyclus::OptionalQuery<bool>(&xqe, query, false);
274 query = string("/*/control/solver/config/coin-or/mps");
275 bool mps = cyclus::OptionalQuery<bool>(&xqe, query, false);
276 ctx_->NewDatum("CoinSolverInfo")
277 ->AddVal("Timeout", timeout)
278 ->AddVal("Verbose", verbose)
279 ->AddVal("Mps", mps)
280 ->Record();
281 } else {
282 throw ValueError("unknown solver name: " + solver_name);
283 }
284}
285
287 std::map<std::string, double>* commod_priority) {
288 double max = std::max_element(
289 commod_priority->begin(),
290 commod_priority->end(),
291 SecondLT< std::pair<std::string, double> >())->second;
292 if (max < 1) {
293 max = 0; // in case no priorities are specified
294 }
295
296 std::map<std::string, double>::iterator it;
297 for (it = commod_priority->begin();
298 it != commod_priority->end();
299 ++it) {
300 if (it->second < 1) {
301 it->second = max + 1;
302 }
303 CLOG(LEV_INFO1) << "Commodity priority for " << it->first
304 << " is " << it->second;
305 }
306}
307
309 InfileTree xqe(*parser_);
310
311 std::string query = "/*/recipe";
312 int num_recipes = xqe.NMatches(query);
313 for (int i = 0; i < num_recipes; i++) {
314 InfileTree* qe = xqe.SubTree(query, i);
315 std::string name = qe->GetString("name");
316 CLOG(LEV_DEBUG3) << "loading recipe: " << name;
317 Composition::Ptr comp = ReadRecipe(qe);
318 comp->Record(ctx_);
319 ctx_->AddRecipe(name, comp);
320 }
321}
322
324 InfileTree xqe(*parser_);
325
327
328 std::string query = "/*/package";
329 int num_packages = xqe.NMatches(query);
330 for (int i = 0; i < num_packages; i++) {
331 InfileTree* qe = xqe.SubTree(query, i);
332 std::string name = cyclus::OptionalQuery<std::string>(qe, "name", "default");
333 CLOG(LEV_DEBUG3) << "loading package: " << name;
334
335 double fill_min = cyclus::OptionalQuery<double>(qe, "fill_min", eps());
336 double fill_max = cyclus::OptionalQuery<double>(qe, "fill_max", std::numeric_limits<double>::max());
337
338 std::string strategy = cyclus::OptionalQuery<std::string>(qe, "strategy", "first");
339
340 ctx_->AddPackage(name, fill_min, fill_max, strategy);
341 }
342}
343
345 InfileTree xqe(*parser_);
346
347 std::string query = "/*/transportunit";
348 int num_transport_units = xqe.NMatches(query);
349 for (int i = 0; i < num_transport_units; i++) {
350 InfileTree* qe = xqe.SubTree(query, i);
351 std::string name = cyclus::OptionalQuery<std::string>(qe, "name", "default");
352 CLOG(LEV_DEBUG3) << "loading transport unit: " << name;
353
354 double fill_min = cyclus::OptionalQuery<double>(qe, "fill_min", eps());
355 double fill_max = cyclus::OptionalQuery<double>(qe, "fill_max", std::numeric_limits<double>::max());
356
357 std::string strategy = cyclus::OptionalQuery<std::string>(qe, "strategy", "first");
358
359 ctx_->AddTransportUnit(name, fill_min, fill_max, strategy);
360 }
361}
362
364 std::vector<AgentSpec> specs = ParseSpecs(file_, format_);
365 for (int i = 0; i < specs.size(); ++i) {
366 specs_[specs[i].alias()] = specs[i];
367 }
368}
369
371 std::map<std::string, std::string> schema_paths;
372 schema_paths["Region"] = "/*/region";
373 schema_paths["Inst"] = "/*/region/institution";
374 schema_paths["Facility"] = "/*/facility";
375
376 InfileTree xqe(*parser_);
377
378 // create prototypes
379 std::string prototype; // defined here for force-create AgentExit tbl
380 std::map<std::string, std::string>::iterator it;
381 for (it = schema_paths.begin(); it != schema_paths.end(); it++) {
382 int num_agents = xqe.NMatches(it->second);
383 for (int i = 0; i < num_agents; i++) {
384 InfileTree* qe = xqe.SubTree(it->second, i);
385 prototype = qe->GetString("name");
386 std::string alias = qe->SubTree("config")->GetElementName(0);
387 AgentSpec spec = specs_[alias];
388
389 Agent* agent = DynamicModule::Make(ctx_, spec);
390
391 // call manually without agent impl injected to keep all Agent state in a
392 // single, consolidated db table
393 agent->Agent::InfileToDb(qe, DbInit(agent, true));
394
395 agent->InfileToDb(qe, DbInit(agent));
396 rec_->Flush();
397
398 std::vector<Cond> conds;
399 conds.push_back(Cond("SimId", "==", rec_->sim_id()));
400 conds.push_back(Cond("SimTime", "==", static_cast<int>(0)));
401 conds.push_back(Cond("AgentId", "==", agent->id()));
402 CondInjector ci(b_, conds);
403 PrefixInjector pi(&ci, "AgentState");
404
405 // call manually without agent impl injected
406 agent->Agent::InitFrom(&pi);
407
408 pi = PrefixInjector(&ci, "AgentState" + spec.Sanitize());
409 agent->InitFrom(&pi);
410 ctx_->AddPrototype(prototype, agent);
411 }
412 }
413
414 // build initial agent instances
415 int nregions = xqe.NMatches(schema_paths["Region"]);
416 for (int i = 0; i < nregions; ++i) {
417 InfileTree* qe = xqe.SubTree(schema_paths["Region"], i);
418 std::string region_proto = qe->GetString("name");
419 Agent* reg = BuildAgent(region_proto, NULL);
420
421 int ninsts = qe->NMatches("institution");
422 for (int j = 0; j < ninsts; ++j) {
423 InfileTree* qe2 = qe->SubTree("institution", j);
424 std::string inst_proto = qe2->GetString("name");
425 Agent* inst = BuildAgent(inst_proto, reg);
426
427 int nfac = qe2->NMatches("initialfacilitylist/entry");
428 for (int k = 0; k < nfac; ++k) {
429 InfileTree* qe3 = qe2->SubTree("initialfacilitylist/entry", k);
430 std::string fac_proto = qe3->GetString("prototype");
431
432 int number = atoi(qe3->GetString("number").c_str());
433 for (int z = 0; z < number; ++z) {
434 Agent* fac = BuildAgent(fac_proto, inst);
435 }
436 }
437 }
438 }
439}
440
441Agent* XMLFileLoader::BuildAgent(std::string proto, Agent* parent) {
442 Agent* m = ctx_->CreateAgent<Agent>(proto);
443 m->Build(parent);
444 if (parent != NULL) {
445 parent->BuildNotify(m);
446 }
447 return m;
448}
449
451 InfileTree xqe(*parser_);
452 std::string query = "/*/control";
453 InfileTree* qe = xqe.SubTree(query);
454
455 std::string handle;
456 if (qe->NMatches("simhandle") > 0) {
457 handle = qe->GetString("simhandle");
458 }
459
460 // get duration
461 std::string dur_str = qe->GetString("duration");
462 int dur = strtol(dur_str.c_str(), NULL, 10);
463 // get start month
464 std::string m0_str = qe->GetString("startmonth");
465 int m0 = strtol(m0_str.c_str(), NULL, 10);
466 // get start year
467 std::string y0_str = qe->GetString("startyear");
468 int y0 = strtol(y0_str.c_str(), NULL, 10);
469 // get decay mode
470 std::string d = OptionalQuery<std::string>(qe, "decay", "manual");
471
472 SimInfo si(dur, y0, m0, handle, d);
473
474 si.explicit_inventory = OptionalQuery<bool>(qe, "explicit_inventory", false);
475 si.explicit_inventory_compact = OptionalQuery<bool>(qe, "explicit_inventory_compact", false);
476
477 // get time step duration
479
480 // get epsilon
481 double eps_ = OptionalQuery<double>(qe, "tolerance_generic", 1e-6);
482 cy_eps = si.eps = eps_;
483
484 // get epsilon resources
485 double eps_rsrc_ = OptionalQuery<double>(qe, "tolerance_resource", 1e-6);
486 cy_eps_rsrc = si.eps_rsrc = eps_rsrc_;
487
488 // get seed
489 si.seed = OptionalQuery<int>(qe, "seed", kDefaultSeed);
490
491 // get stride
492 si.stride = OptionalQuery<int>(qe, "stride", kDefaultStride);
493
494 ctx_->InitSim(si);
495}
496
497} // 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
T * CreateAgent(std::string proto_name)
Create a new agent by cloning the named prototype.
Definition context.h:195
Datum * NewDatum(std::string title)
See Recorder::NewDatum documentation.
Definition context.cc:361
void AddPrototype(std::string name, Agent *m)
Adds a prototype to a simulation-wide accessible list, a prototype can not be added more than once.
Definition context.cc:160
void DelAgent(Agent *m)
Destructs and cleans up m (and it's children recursively).
Definition context.cc:115
void AddRecipe(std::string name, Composition::Ptr c)
Adds a composition recipe to a simulation-wide accessible list.
Definition context.cc:189
void AddTransportUnit(std::string name, int fill_min=0, int fill_max=std::numeric_limits< int >::max(), std::string strategy="first")
Adds a transport unit type to a simulation-wide accessible list.
Definition context.cc:237
void AddPackage(std::string name, double fill_min=0, double fill_max=std::numeric_limits< double >::max(), std::string strategy="first")
Adds a package type to a simulation-wide accessible list.
Definition context.cc:204
void RecordPackage(Package::Ptr)
Records package information.
Definition context.cc:215
void InitSim(SimInfo si)
Initializes the simulation time parameters.
Definition context.cc:273
Datum * AddVal(const char *field, boost::spirit::hold_any val, std::vector< int > *shape=NULL)
Add an arbitrary field-value pair to the datum.
Definition datum.cc:22
void Record()
Record this datum to its Recorder.
Definition datum.cc:35
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
boost::uuids::uuid sim_id()
returns the unique id associated with this cyclus simulation.
Definition recorder.cc:49
void Flush()
Flushes all buffered Datum objects and flushes all registered backends.
Definition recorder.cc:92
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.
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.
@ 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::string BuildMasterSchema(std::string schema_path, std::string infile, std::string format)
Builds and returns a master cyclus input xml schema that includes the sub-schemas defined by all inst...
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::vector< AgentSpec > ParseSpecs(std::string infile, std::string format)
Returns a list of the full module+agent spec for all agents in the given input file.
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