From 000e33fe99c4060fa6f454325d6023523f15ece2 Mon Sep 17 00:00:00 2001 From: Katie Mummah Date: Fri, 20 Oct 2023 10:55:50 -0600 Subject: [PATCH] fix db and replace merge with rebase --- src/context.cc | 33 ++++++++++++++------------------- src/sim_init.cc | 7 +++---- 2 files changed, 17 insertions(+), 23 deletions(-) diff --git a/src/context.cc b/src/context.cc index dd15d3bfbf..ad0214b211 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..de97f79e7e 100644 --- a/src/sim_init.cc +++ b/src/sim_init.cc @@ -153,6 +153,9 @@ void SimInit::LoadInfo() { std::string d = dq.GetVal("Decay"); si_ = SimInfo(dur, y0, m0, h, d); + si_.seed = qr.GetVal("Seed"); + si_.stride = qr.GetVal("Stride"); + si_.parent_sim = qr.GetVal("ParentSimId"); qr = b_->Query("TimeStepDur", NULL); @@ -160,10 +163,6 @@ void SimInit::LoadInfo() { // 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");