diff --git a/src/context.cc b/src/context.cc index dd15d3bfbf..f2e3c8914a 100644 --- a/src/context.cc +++ b/src/context.cc @@ -22,13 +22,13 @@ SimInfo::SimInfo() m0(0), dt(kDefaultTimeStepDur), decay("manual"), - seed(kDefaultSeed), - stride(kDefaultStride), branch_time(-1), explicit_inventory(false), explicit_inventory_compact(false), parent_sim(boost::uuids::nil_uuid()), - parent_type("init") {} + parent_type("init"), + seed(kDefaultSeed), + stride(kDefaultStride) {} SimInfo::SimInfo(int dur, int y0, int m0, std::string handle) : duration(dur), @@ -36,14 +36,14 @@ SimInfo::SimInfo(int dur, int y0, int m0, std::string handle) m0(m0), dt(kDefaultTimeStepDur), decay("manual"), - seed(kDefaultSeed), - stride(kDefaultStride), branch_time(-1), handle(handle), explicit_inventory(false), explicit_inventory_compact(false), parent_sim(boost::uuids::nil_uuid()), - parent_type("init") {} + parent_type("init"), + seed(kDefaultSeed), + stride(kDefaultStride) {} SimInfo::SimInfo(int dur, int y0, int m0, std::string handle, std::string d) : duration(dur), @@ -51,14 +51,14 @@ SimInfo::SimInfo(int dur, int y0, int m0, std::string handle, std::string d) m0(m0), dt(kDefaultTimeStepDur), decay(d), - seed(kDefaultSeed), - stride(kDefaultStride), branch_time(-1), handle(handle), explicit_inventory(false), explicit_inventory_compact(false), parent_sim(boost::uuids::nil_uuid()), - parent_type("init") {} + parent_type("init"), + seed(kDefaultSeed), + stride(kDefaultStride), {} SimInfo::SimInfo(int dur, boost::uuids::uuid parent_sim, int branch_time, std::string parent_type, @@ -68,14 +68,14 @@ SimInfo::SimInfo(int dur, boost::uuids::uuid parent_sim, m0(-1), dt(kDefaultTimeStepDur), decay("manual"), - seed(kDefaultSeed), - stride(kDefaultStride), parent_sim(parent_sim), parent_type(parent_type), branch_time(branch_time), explicit_inventory(false), explicit_inventory_compact(false), - handle(handle) {} + handle(handle), + seed(kDefaultSeed), + stride(kDefaultStride) {} Context::Context(Timer* ti, Recorder* rec) : ti_(ti), @@ -192,8 +192,8 @@ void Context::InitSim(SimInfo si) { ->AddVal("InitialYear", si.y0) ->AddVal("InitialMonth", si.m0) ->AddVal("Duration", si.duration) - ->AddVal("Seed", si.seed) - ->AddVal("Stride", si.stride) + ->AddVal("Seed", static_cast(si.seed)) + ->AddVal("Stride", static_cast(si.stride)) ->AddVal("ParentSimId", si.parent_sim) ->AddVal("ParentType", si.parent_type) ->AddVal("BranchTime", si.branch_time) @@ -221,11 +221,6 @@ void Context::InitSim(SimInfo si) { ->AddVal("DurationSecs", static_cast(si.dt)) ->Record(); - NewDatum("RNGInfo") - ->AddVal("Seed", static_cast(si.seed)) - ->AddVal("Stride", static_cast(si.stride)) - ->Record(); - NewDatum("Epsilon") ->AddVal("GenericEpsilon", si.eps) ->AddVal("ResourceEpsilon", si.eps_rsrc) diff --git a/src/sim_init.cc b/src/sim_init.cc index 7bd8f28398..20a44271af 100644 --- a/src/sim_init.cc +++ b/src/sim_init.cc @@ -155,15 +155,14 @@ void SimInit::LoadInfo() { si_.parent_sim = qr.GetVal("ParentSimId"); + si_.seed = qr.GetVal("Seed"); + si_.stride = qr.GetVal("Stride"); + qr = b_->Query("TimeStepDur", NULL); // TODO: when the backends support uint64_t, the int template here // should be updated to uint64_t. si_.dt = qr.GetVal("DurationSecs"); - qr = b_->Query("RNGInfo", NULL); - si_.seed = qr.GetVal("Seed"); - si_.stride = qr.GetVal("Stride"); - qr = b_->Query("Epsilon", NULL); si_.eps = qr.GetVal("GenericEpsilon"); si_.eps_rsrc = qr.GetVal("ResourceEpsilon");