CYCAMORE
Loading...
Searching...
No Matches
build/cycamore/storage_tests.cc
Go to the documentation of this file.
1#include <gtest/gtest.h>
2
3#include "storage_tests.h"
4
5namespace cycamore {
6
7// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
9 src_facility_ = new Storage(tc_.get());
12}
13
15 delete src_facility_;
16}
17
19 in_r1 = "in_r1";
20 in_c1.push_back("in_c1");
21 out_c1.push_back("out_c1");
22 residence_time = 10;
23 max_inv_size = 200;
24 throughput = 20;
26 package = "foo";
27 // Active period longer than any of the residence time related-tests needs
28
29
30 cyclus::CompMap v;
31 v[922350000] = 1;
32 v[922380000] = 2;
33 cyclus::Composition::Ptr recipe = cyclus::Composition::CreateFromAtom(v);
34 tc_.get()->AddRecipe(in_r1, recipe);
35}
36
48
50 EXPECT_EQ(residence_time, fac->residence_time);
51 EXPECT_EQ(max_inv_size, fac->max_inv_size);
52 EXPECT_EQ(throughput, fac->throughput);
53 EXPECT_EQ(in_r1, fac->in_recipe);
54 EXPECT_EQ(package, fac->package);
55}
56
58 cyclus::Material::Ptr mat){
59 double amt = mat->quantity();
60 double before = fac->inventory.quantity();
61 fac->AddMat_(mat);
62 double after = fac->inventory.quantity();
63 EXPECT_EQ(amt, after - before);
64}
65
66void StorageTest::TestBuffers(Storage* fac, double inv,
67 double proc, double ready, double stocks){
68 double t = tc_.get()->time();
69
70 EXPECT_EQ(inv, fac->inventory.quantity());
71 EXPECT_EQ(proc, fac->processing.quantity());
72 EXPECT_EQ(stocks, fac->stocks.quantity());
73 EXPECT_EQ(ready, fac->ready.quantity());
74}
75
76void StorageTest::TestStocks(Storage* fac, cyclus::CompMap v){
77
78 cyclus::toolkit::ResBuf<cyclus::Material>* buffer = &fac->stocks;
79 Material::Ptr final_mat = cyclus::ResCast<Material>(buffer->PopBack());
80 cyclus::CompMap final_comp = final_mat->comp()->atom();
81 EXPECT_EQ(final_comp,v);
82
83}
84
85void StorageTest::TestCurrentCap(Storage* fac, double inv){
86
87 EXPECT_EQ(inv, fac->current_capacity());
88}
89
91
92 EXPECT_EQ(t, fac->ready_time());
93}
94
95// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
97 Storage* cloned_fac =
98 dynamic_cast<Storage*> (src_facility_->Clone());
99 TestInitState(cloned_fac);
100}
101
102// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
103TEST_F(StorageTest, InitialState) {
104 // Test things about the initial state of the facility here
106}
107
108// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
109TEST_F(StorageTest, CurrentCapacity){
111 max_inv_size = cyclus::CY_LARGE_DOUBLE;
112 SetUpStorage();
114}
115
116// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
118 EXPECT_NO_THROW(std::string s = src_facility_->str());
119 // Test Storage specific aspects of the print method here
120}
121
122// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
124 double cap = max_inv_size;
125 cyclus::Material::Ptr mat = cyclus::NewBlankMaterial(0.5*cap);
127
128 cyclus::Composition::Ptr rec = tc_.get()->GetRecipe(in_r1);
129 cyclus::Material::Ptr recmat = cyclus::Material::CreateUntracked(0.5*cap, rec);
130 TestAddMat(src_facility_, recmat);
131}
132
133// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
135 ASSERT_NO_THROW(src_facility_->Tick());
136 // Test Storage specific behaviors of the Tick function here
137}
138
139// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
141
142 // initially, nothing in the buffers
143 TestBuffers(src_facility_,0,0,0,0);
144
145 double cap = throughput;
146 cyclus::Composition::Ptr rec = tc_.get()->GetRecipe(in_r1);
147 cyclus::Material::Ptr mat = cyclus::Material::CreateUntracked(cap, rec);
149
150 // affter add, the inventory has the material
151 TestBuffers(src_facility_,cap,0,0,0);
152
153 EXPECT_NO_THROW(src_facility_->Tock());
154
155 // after tock, the processing buffer has the material
156 TestBuffers(src_facility_,0,cap,0,0);
157
158 EXPECT_EQ(0, tc_.get()->time());
159 for( int i = 1; i < residence_time-1; ++i){
160 tc_.get()->time(i);
161 EXPECT_NO_THROW(src_facility_->Tock());
162 TestBuffers(src_facility_,0,cap,0,0);
163 }
164
165 tc_.get()->time(residence_time);
166 EXPECT_EQ(residence_time, tc_.get()->time());
169 TestBuffers(src_facility_,0,0,0,cap);
170
171 tc_.get()->time(residence_time+1);
174 TestBuffers(src_facility_,0,0,0,cap);
175
176}
177
178// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
179TEST_F(StorageTest, NoProcessTime) {
180 // tests what happens when the process time is zero
181 residence_time = 0;
182 SetUpStorage();
183 EXPECT_EQ(0, residence_time);
184
185 double cap = throughput;
186 cyclus::Composition::Ptr rec = tc_.get()->GetRecipe(in_r1);
187 cyclus::Material::Ptr mat = cyclus::Material::CreateUntracked(cap, rec);
189
190 // affter add, the inventory has the material
191 TestBuffers(src_facility_,cap,0,0,0);
192
193 EXPECT_NO_THROW(src_facility_->Tock());
194
195 // affter tock, the stocks have the material
196 TestBuffers(src_facility_,0,0,0,cap);
197}
198
199TEST_F(StorageTest, NoConvert) {
200// Make sure no conversion occurs
201 double cap = throughput;
202 cyclus::Composition::Ptr rec = tc_.get()->GetRecipe(in_r1);
203 cyclus::Material::Ptr mat = cyclus::Material::CreateUntracked(cap, rec);
205
206 EXPECT_NO_THROW(src_facility_->Tock());
207
208 tc_.get()->time(residence_time);
210 EXPECT_NO_THROW(src_facility_->Tock());
211 TestBuffers(src_facility_,0,0,0,cap);
212 cyclus::CompMap in_rec;
213 in_rec[922350000] = 1;
214 in_rec[922380000] = 2;
216}
217
218TEST_F(StorageTest, MultipleSmallBatches) {
219 // Add first small batch
220 double cap = throughput;
221 cyclus::Composition::Ptr rec = tc_.get()->GetRecipe(in_r1);
222 cyclus::Material::Ptr mat = cyclus::Material::CreateUntracked(0.2*cap, rec);
224
225 // After add, material is in inventory
226 TestBuffers(src_facility_,0.2*cap,0,0,0);
227
228 // Move first batch into processing
230 TestBuffers(src_facility_,0,0.2*cap,0,0);
231
232 // Add second small batch
233 tc_.get()->time(2);
235 cyclus::Material::Ptr mat1 = cyclus::Material::CreateUntracked(0.3*cap, rec);
237 TestBuffers(src_facility_,0.3*cap,0.2*cap,0,0);
238
239 // Move second batch into processing
240 EXPECT_NO_THROW(src_facility_->Tock());
241 TestBuffers(src_facility_,0,0.5*cap,0,0);
242
243 // Move first batch to stocks
244 tc_.get()->time(residence_time);
246 EXPECT_NO_THROW(src_facility_->Tock());
247 TestBuffers(src_facility_,0,0.3*cap,0,0.2*cap);
248
249 tc_.get()->time(residence_time+2);
250 EXPECT_NO_THROW(src_facility_->Tock());
251 TestBuffers(src_facility_,0,0,0,0.5*cap);
252}
253
254
255TEST_F(StorageTest, ChangeCapacity) {
256 // src_facility_->discrete_handling_(0);
257 max_inv_size = 10000;
258 // Set throughput, add first batch
259 throughput = 300;
260 SetUpStorage();
261 double cap1 = throughput;
262 cyclus::Composition::Ptr rec = tc_.get()->GetRecipe(in_r1);
263 cyclus::Material::Ptr mat1 = cyclus::Material::CreateUntracked(cap1, rec);
265 EXPECT_NO_THROW(src_facility_->Tock());
266 TestBuffers(src_facility_,0,cap1,0,0);
267
268 // Increase throughput, add second and third batches
269 tc_.get()->time(2);
270 throughput = 500;
271 SetUpStorage();
272 double cap2 = throughput;
273 cyclus::Material::Ptr mat2 = cyclus::Material::CreateUntracked(cap2,rec);
275 EXPECT_NO_THROW(src_facility_->Tock());
276 TestBuffers(src_facility_,0,cap2+cap1,0,0);
277 tc_.get()->time(3);
278 cyclus::Material::Ptr mat3 = cyclus::Material::CreateUntracked(cap2,rec);
280 EXPECT_NO_THROW(src_facility_->Tock());
281 TestBuffers(src_facility_,0,cap2*2+cap1,0,0);
282
283 // Move first batch to stocks
284 tc_.get()->time(residence_time);
285 EXPECT_NO_THROW(src_facility_->Tock());
286 TestBuffers(src_facility_,0,2*cap2,0,cap1);
287
288 // Decrease throughput and move portion of second batch to stocks
289 throughput = 400;
290 SetUpStorage();
291 tc_.get()->time(residence_time+2);
292 EXPECT_EQ(400, throughput);
293 EXPECT_NO_THROW(src_facility_->Tock());
294 TestBuffers(src_facility_,0,cap2,100,cap1+400);
295
296 // Continue to move second batch // and portion of third
297 tc_.get()->time(residence_time+3);
298 EXPECT_NO_THROW(src_facility_->Tock());
299 TestBuffers(src_facility_,0,0,200,cap1+cap2+300);
300
301 // Move remainder of third batch
302 tc_.get()->time(residence_time+4);
303 EXPECT_NO_THROW(src_facility_->Tock());
304 TestBuffers(src_facility_,0,0,0,cap1+cap2+cap2);
305
306}
307
308TEST_F(StorageTest, TwoBatchSameTime) {
309 // Add first small batch
310 double cap = throughput;
311 cyclus::Composition::Ptr rec = tc_.get()->GetRecipe(in_r1);
312 cyclus::Material::Ptr mat = cyclus::Material::CreateUntracked(0.2*cap, rec);
314
315 // After add, material is in inventory
316 TestBuffers(src_facility_,0.2*cap,0,0,0);
317 cyclus::Material::Ptr mat1 = cyclus::Material::CreateUntracked(0.2*cap, rec);
319 TestBuffers(src_facility_,0.4*cap,0,0,0);
320
321 EXPECT_NO_THROW(src_facility_->Tock());
322 TestBuffers(src_facility_,0,0.4*cap,0,0);
323
324 // Move material to stocks
325 tc_.get()->time(residence_time);
326 EXPECT_NO_THROW(src_facility_->Tock());
327 TestBuffers(src_facility_,0,0,0,0.4*cap);
328}
329
330TEST_F(StorageTest,ChangeProcessTime){
331 // Initialize process time variable and add first batch
332 int proc_time1 = residence_time;
333 double cap = throughput;
334 cyclus::Composition::Ptr rec = tc_.get()->GetRecipe(in_r1);
335 cyclus::Material::Ptr mat = cyclus::Material::CreateUntracked(cap, rec);
337 TestBuffers(src_facility_,cap,0,0,0);
338
339 // Move material to processing
340 EXPECT_NO_THROW(src_facility_->Tock());
341 TestBuffers(src_facility_,0,cap,0,0);
342
343 // Add second batch
344 cyclus::Material::Ptr mat1 = cyclus::Material::CreateUntracked(cap,rec);
345 tc_.get()->time(8);
347 TestBuffers(src_facility_,cap,cap,0,0);
348 EXPECT_NO_THROW(src_facility_->Tock());
349 TestBuffers(src_facility_,0,2*cap,0,0);
350
351 // Increase process time
352 residence_time = proc_time1+5;
353 SetUpStorage();
354 // src_facility_->residence_time = proc_time1+5;
355 EXPECT_EQ(residence_time,proc_time1+5);
356 EXPECT_EQ(residence_time,15);
357 int proc_time2 = residence_time;
358
359 // Make sure material doesn't move before new process time
360 for( int i=proc_time1; i < proc_time2 - 1; ++i){
361 tc_.get()->time(i);
362 EXPECT_NO_THROW(src_facility_->Tock());
363 TestBuffers(src_facility_,0,2*cap,0,0);
364 }
365
366 // Move first batch to stocks
367 tc_.get()->time(proc_time2);
368 EXPECT_NO_THROW(src_facility_->Tock());
369 TestBuffers(src_facility_,0,cap,0,cap);
370
371 // Decrease process time
372 residence_time = proc_time2-3;
373 SetUpStorage();
374 int proc_time3 = residence_time;
375
376 // Move second batch to stocks
377 tc_.get()->time(proc_time3 +8);
378 EXPECT_NO_THROW(src_facility_->Tock());
379 TestBuffers(src_facility_,0,0,0,2*cap);
380
381}
382
383TEST_F(StorageTest,DifferentRecipe){
384 // Initialize material with different recipe than in_recipe
385 double cap = throughput;
386 cyclus::CompMap v;
387 v[922350000] = 3;
388 v[922380000] = 1;
389 cyclus::Composition::Ptr rec = cyclus::Composition::CreateFromAtom(v);
390 cyclus::Material::Ptr mat = cyclus::Material::CreateUntracked(cap, rec);
391
392 // Move material through the facility
394 TestBuffers(src_facility_,cap,0,0,0);
395 EXPECT_NO_THROW(src_facility_->Tock());
396 TestBuffers(src_facility_,0,cap,0,0);
397 tc_.get()->time(residence_time);
398 EXPECT_NO_THROW(src_facility_->Tock());
399 TestBuffers(src_facility_,0,0,0,cap);
400}
401
402TEST_F(StorageTest, BehaviorTest){
403 // Verify Storage behavior
404
405 std::string config =
406 " <in_commods> <val>spent_fuel</val> </in_commods> "
407 " <out_commods> <val>dry_spent</val> </out_commods> "
408 " <residence_time>1</residence_time>"
409 " <max_inv_size>10</max_inv_size>";
410
411 int simdur = 3;
412
413 cyclus::MockSim sim(cyclus::AgentSpec (":cycamore:Storage"), config, simdur);
414
415 sim.AddSource("spent_fuel").Finalize();
416 sim.AddSink("dry_spent").Finalize();
417
418 int id = sim.Run();
419
420 // return all transactions where our sstorage facility is the sender
421 std::vector<cyclus::Cond> conds;
422 conds.push_back(cyclus::Cond("Commodity", "==", std::string("dry_spent")));
423 cyclus::QueryResult qr = sim.db().Query("Transactions", &conds);
424 int n_trans = qr.rows.size();
425 EXPECT_EQ(1, n_trans) << "expected 1 transactions, got " << n_trans;
426
427}
428
429TEST_F(StorageTest, MultipleCommods){
430 // Verify Storage accepting Multiple Commods
431
432 std::string config =
433 " <in_commods> <val>spent_fuel</val>"
434 " <val>spent_fuel2</val> </in_commods>"
435 " <in_commod_prefs> <val>1</val>"
436 " <val>1</val> </in_commod_prefs>"
437 " <out_commods> <val>dry_spent</val> </out_commods> "
438 " <max_inv_size>10</max_inv_size>";
439
440 int simdur = 2;
441
442 cyclus::MockSim sim(cyclus::AgentSpec (":cycamore:Storage"), config, simdur);
443
444 sim.AddSource("spent_fuel").capacity(5).Finalize();
445 sim.AddSource("spent_fuel2").capacity(5).Finalize();
446 sim.AddSink("dry_spent").Finalize();
447
448 int id = sim.Run();
449
450 // return all transactions where our sstorage facility is the acceptor
451 std::vector<cyclus::Cond> conds;
452 conds.push_back(cyclus::Cond("Commodity", "==", std::string("spent_fuel")));
453 cyclus::QueryResult qr = sim.db().Query("Transactions", &conds);
454 int n_trans = qr.rows.size();
455 EXPECT_EQ(1, n_trans) << "expected 1 transactions, got " << n_trans;
456
457 std::vector<cyclus::Cond> conds2;
458 conds2.push_back(cyclus::Cond("Commodity", "==", std::string("spent_fuel2")));
459 cyclus::QueryResult qr2 = sim.db().Query("Transactions", &conds2);
460 int n_trans2 = qr2.rows.size();
461 EXPECT_EQ(1, n_trans2) << "expected 1 transactions, got " << n_trans;
462}
463
464
465// Should get one transaction in a 2 step simulation when agent is active for
466// one step and dormant for one step
467TEST_F(StorageTest, ActiveDormant){
468 std::string config =
469 " <in_commods> <val>spent_fuel</val> </in_commods> "
470 " <out_commods> <val>dry_spent</val> </out_commods> "
471 " <throughput>1</throughput>"
472 " <active_buying_val>1</active_buying_val>"
473 " <dormant_buying_val>1</dormant_buying_val>";
474
475 int simdur = 2;
476
477 cyclus::MockSim sim(cyclus::AgentSpec (":cycamore:Storage"), config, simdur);
478
479 sim.AddSource("spent_fuel").capacity(5).Finalize();
480 sim.AddSink("dry_spent").Finalize();
481
482 int id = sim.Run();
483
484 // return all transactions where our storage facility is the acceptor
485 std::vector<cyclus::Cond> conds;
486 conds.push_back(cyclus::Cond("Commodity", "==", std::string("spent_fuel")));
487 cyclus::QueryResult qr = sim.db().Query("Transactions", &conds);
488 int n_trans = qr.rows.size();
489 EXPECT_EQ(1, n_trans) << "expected 1 transactions, got " << n_trans;
490 }
491
492 // Should get two transactions in a 2 step simulation when there is no
493 // dormant period, i.e. agent is always active
494TEST_F(StorageTest, NoDormant){
495 std::string config =
496 " <in_commods> <val>spent_fuel</val> </in_commods> "
497 " <out_commods> <val>dry_spent</val> </out_commods> "
498 " <throughput>1</throughput>"
499 " <active_buying_frequency_type>Fixed</active_buying_frequency_type>"
500 " <active_buying_val>1</active_buying_val>"
501 " <dormant_buying_frequency_type>Fixed</dormant_buying_frequency_type>"
502 " <dormant_buying_val>-1</dormant_buying_val>";
503
504 int simdur = 3;
505
506 cyclus::MockSim sim(cyclus::AgentSpec (":cycamore:Storage"), config, simdur);
507
508 sim.AddSource("spent_fuel").capacity(5).Finalize();
509 sim.AddSink("dry_spent").Finalize();
510
511 int id = sim.Run();
512
513 std::vector<cyclus::Cond> conds;
514 conds.push_back(cyclus::Cond("Commodity", "==", std::string("spent_fuel")));
515 cyclus::QueryResult qr = sim.db().Query("Transactions", &conds);
516 int n_trans = qr.rows.size();
517 EXPECT_EQ(3, n_trans) << "expected 3 transactions, got " << n_trans;
518 }
519
520TEST_F(StorageTest, UniformActiveNormalDormant){
521 std::string config =
522 " <in_commods> <val>spent_fuel</val> </in_commods> "
523 " <out_commods> <val>dry_spent</val> </out_commods> "
524 " <throughput>1</throughput>"
525 " <active_buying_frequency_type>Uniform</active_buying_frequency_type>"
526 " <active_buying_min>2</active_buying_min>"
527 " <active_buying_max>3</active_buying_max>"
528 " <dormant_buying_frequency_type>Normal</dormant_buying_frequency_type>"
529 " <dormant_buying_mean>5</dormant_buying_mean>"
530 " <dormant_buying_stddev>1</dormant_buying_stddev>";
531
532 int simdur = 20;
533
534 cyclus::MockSim sim(cyclus::AgentSpec (":cycamore:Storage"), config, simdur);
535
536 sim.AddSource("spent_fuel").capacity(5).Finalize();
537 sim.AddSink("dry_spent").Finalize();
538
539 int id = sim.Run();
540
541 std::vector<cyclus::Cond> conds;
542 conds.push_back(cyclus::Cond("Commodity", "==", std::string("spent_fuel")));
543 cyclus::QueryResult qr = sim.db().Query("Transactions", &conds);
544 // confirm that transactions are only occurring during active periods
545 // first cycle includes time steps 0 and 1
546 EXPECT_EQ(0, qr.GetVal<int>("Time", 0));
547 EXPECT_EQ(1, qr.GetVal<int>("Time", 1));
548 // second cycle (lines 2, 3 and 4) includes time steps 7, 8, and 9
549 EXPECT_EQ(7, qr.GetVal<int>("Time", 2));
550 EXPECT_EQ(8, qr.GetVal<int>("Time", 3));
551 EXPECT_EQ(9, qr.GetVal<int>("Time", 4));
552}
553
554TEST_F(StorageTest, FixedBuyingSize){
555 std::string config =
556 " <in_commods> <val>spent_fuel</val> </in_commods> "
557 " <out_commods> <val>dry_spent</val> </out_commods> "
558 " <throughput>1</throughput>"
559 " <buying_size_type>Fixed</buying_size_type>"
560 " <buying_size_val>0.5</buying_size_val>";
561
562 int simdur = 2;
563
564 cyclus::MockSim sim(cyclus::AgentSpec (":cycamore:Storage"), config, simdur);
565
566 sim.AddSource("spent_fuel").Finalize();
567 int id = sim.Run();
568
569 cyclus::QueryResult qr = sim.db().Query("Resources", NULL);
570 EXPECT_NEAR(0.5, qr.GetVal<double>("Quantity", 0), 0.00001);
571 EXPECT_NEAR(0.5, qr.GetVal<double>("Quantity", 1), 0.00001);
572}
573
574TEST_F(StorageTest, UniformBuyingSize){
575 std::string config =
576 " <in_commods> <val>spent_fuel</val> </in_commods> "
577 " <out_commods> <val>dry_spent</val> </out_commods> "
578 " <throughput>1</throughput>"
579 " <buying_size_type>Uniform</buying_size_type>"
580 " <buying_size_min>0.5</buying_size_min>"
581 " <buying_size_max>0.7</buying_size_max>";
582
583 int simdur = 2;
584
585 cyclus::MockSim sim(cyclus::AgentSpec (":cycamore:Storage"), config, simdur);
586
587 sim.AddSource("spent_fuel").Finalize();
588 int id = sim.Run();
589
590 cyclus::QueryResult qr = sim.db().Query("Resources", NULL);
591 EXPECT_NEAR(0.56393, qr.GetVal<double>("Quantity", 0), 0.00001);
592 EXPECT_NEAR(0.68825, qr.GetVal<double>("Quantity", 1), 0.00001);
593}
594
595TEST_F(StorageTest, NormalBuyingSize){
596 std::string config =
597 " <in_commods> <val>spent_fuel</val> </in_commods> "
598 " <out_commods> <val>dry_spent</val> </out_commods> "
599 " <throughput>1</throughput>"
600 " <buying_size_type>Normal</buying_size_type>"
601 " <buying_size_mean>0.5</buying_size_mean>"
602 " <buying_size_stddev>0.1</buying_size_stddev>";
603
604 int simdur = 2;
605
606 cyclus::MockSim sim(cyclus::AgentSpec (":cycamore:Storage"), config, simdur);
607
608 sim.AddSource("spent_fuel").Finalize();
609
610 int id = sim.Run();
611
612 cyclus::QueryResult qr = sim.db().Query("Resources", NULL);
613 EXPECT_NEAR(0.64083, qr.GetVal<double>("Quantity", 0), 0.00001);
614 EXPECT_NEAR(0.32648, qr.GetVal<double>("Quantity", 1), 0.00001);
615}
616
617TEST_F(StorageTest, NormalActiveDormantBuyingSize){
618 std::string config =
619 " <in_commods> <val>spent_fuel</val> </in_commods> "
620 " <out_commods> <val>dry_spent</val> </out_commods> "
621 " <throughput>1</throughput>"
622 " <active_buying_frequency_type>Normal</active_buying_frequency_type>"
623 " <active_buying_mean>3</active_buying_mean>"
624 " <active_buying_stddev>1</active_buying_stddev>"
625 " <dormant_buying_frequency_type>Normal</dormant_buying_frequency_type>"
626 " <dormant_buying_mean>2</dormant_buying_mean>"
627 " <dormant_buying_stddev>1</dormant_buying_stddev>"
628 " <buying_size_type>Normal</buying_size_type>"
629 " <buying_size_mean>0.5</buying_size_mean>"
630 " <buying_size_stddev>0.1</buying_size_stddev>";
631
632 int simdur = 15;
633
634 cyclus::MockSim sim(cyclus::AgentSpec (":cycamore:Storage"), config, simdur);
635
636 sim.AddSource("spent_fuel").capacity(5).Finalize();
637 sim.AddSink("dry_spent").Finalize();
638
639 int id = sim.Run();
640
641 std::vector<cyclus::Cond> conds;
642 conds.push_back(cyclus::Cond("Commodity", "==", std::string("spent_fuel")));
643 cyclus::QueryResult qr = sim.db().Query("Transactions", &conds);
644 int n_trans = qr.rows.size();
645 EXPECT_EQ(10, n_trans) << "expected 10 transactions, got " << n_trans;
646 // confirm that transactions are only occurring during active periods
647 // first cycle includes time steps 0 - 3
648 EXPECT_EQ(0, qr.GetVal<int>("Time", 0));
649 EXPECT_EQ(3, qr.GetVal<int>("Time", 3));
650 // second cycle (rows 4 and 4) include time steps 6 and 7
651 EXPECT_EQ(6, qr.GetVal<int>("Time", 4));
652 EXPECT_EQ(7, qr.GetVal<int>("Time", 5));
653 // third cycle (row 6) includes time step 8 -9
654 EXPECT_EQ(8, qr.GetVal<int>("Time", 6));
655 EXPECT_EQ(9, qr.GetVal<int>("Time", 7));
656 // fourth cycle (rows 8, 9) includes time steps 13 - 14
657 EXPECT_EQ(13, qr.GetVal<int>("Time", 8));
658 EXPECT_EQ(14, qr.GetVal<int>("Time", 9));
659
660 qr = sim.db().Query("Resources", NULL);
661 EXPECT_NEAR(0.61256, qr.GetVal<double>("Quantity", 0), 0.00001);
662 EXPECT_NEAR(0.62217, qr.GetVal<double>("Quantity", 1), 0.00001);
663 EXPECT_NEAR(0.39705, qr.GetVal<double>("Quantity", 2), 0.00001);
664}
665
666TEST_F(StorageTest, IncorrectBuyPolSetupUniform) {
667 // uniform missing min and max
668 std::string config_uniform =
669 " <in_commods> <val>spent_fuel</val> </in_commods> "
670 " <out_commods> <val>dry_spent</val> </out_commods> "
671 " <throughput>1</throughput>"
672 " <active_buying_frequency_type>Uniform</active_buying_frequency_type>";
673
674 int simdur = 15;
675
676 cyclus::MockSim sim(cyclus::AgentSpec (":cycamore:Storage"), config_uniform,
677 simdur);
678 EXPECT_THROW(sim.Run(), cyclus::ValueError);
679}
680
681TEST_F(StorageTest, IncorrectBuyPolSetupNormal) {
682 // normal missing mean and std dev
683 std::string config_normal =
684 " <in_commods> <val>spent_fuel</val> </in_commods> "
685 " <out_commods> <val>dry_spent</val> </out_commods> "
686 " <throughput>1</throughput>"
687 " <active_buying_frequency_type>Normal</active_buying_frequency_type>";
688 int simdur = 15;
689
690 cyclus::MockSim sim(cyclus::AgentSpec (":cycamore:Storage"), config_normal,
691 simdur);
692 EXPECT_THROW(sim.Run(), cyclus::ValueError);
693}
694
695TEST_F(StorageTest, IncorrectBuyPolSetupMinMax) {
696 // tries to set min > max
697 std::string config_uniform_min_bigger_max =
698 " <in_commods> <val>spent_fuel</val> </in_commods> "
699 " <out_commods> <val>dry_spent</val> </out_commods> "
700 " <throughput>1</throughput>"
701 " <active_buying_frequency_type>Uniform</active_buying_frequency_type>"
702 " <active_buying_min>3</active_buying_min>"
703 " <active_buying_max>2</active_buying_max>";
704
705 int simdur = 15;
706
707 cyclus::MockSim sim(cyclus::AgentSpec (":cycamore:Storage"),
708 config_uniform_min_bigger_max, simdur);
709 EXPECT_THROW(sim.Run(), cyclus::ValueError);
710}
711
712TEST_F(StorageTest, PositionInitialize){
713 // Verify Storage behavior
714
715 std::string config =
716 " <in_commods> <val>spent_fuel</val> </in_commods> "
717 " <out_commods> <val>dry_spent</val> </out_commods> "
718 " <residence_time>1</residence_time>"
719 " <max_inv_size>10</max_inv_size>";
720
721 int simdur = 3;
722
723 cyclus::MockSim sim(cyclus::AgentSpec (":cycamore:Storage"), config, simdur);
724
725 sim.AddSource("spent_fuel").Finalize();
726 sim.AddSink("dry_spent").Finalize();
727
728 int id = sim.Run();
729
730 cyclus::QueryResult qr = sim.db().Query("AgentPosition", NULL);
731 EXPECT_EQ(qr.GetVal<double>("Latitude"), 0.0);
732 EXPECT_EQ(qr.GetVal<double>("Longitude"), 0.0);
733}
734
735TEST_F(StorageTest, Longitude){
736 // Verify Storage behavior
737
738 std::string config =
739 " <in_commods> <val>spent_fuel</val> </in_commods> "
740 " <out_commods> <val>dry_spent</val> </out_commods> "
741 " <residence_time>1</residence_time>"
742 " <max_inv_size>10</max_inv_size>"
743 " <latitude>50.0</latitude> "
744 " <longitude>35.0</longitude> ";
745
746 int simdur = 3;
747
748 cyclus::MockSim sim(cyclus::AgentSpec (":cycamore:Storage"), config, simdur);
749
750 sim.AddSource("spent_fuel").Finalize();
751 sim.AddSink("dry_spent").Finalize();
752
753 int id = sim.Run();
754
755 cyclus::QueryResult qr = sim.db().Query("AgentPosition", NULL);
756 EXPECT_EQ(qr.GetVal<double>("Latitude"), 50.0);
757 EXPECT_EQ(qr.GetVal<double>("Longitude"), 35.0);
758}
759
760TEST_F(StorageTest, RQ_Inventory_Invalid) {
761 std::string config =
762 " <in_commods> <val>spent_fuel</val> </in_commods> "
763 " <out_commods> <val>dry_spent</val> </out_commods> "
764 " <max_inv_size>5</max_inv_size>"
765 " <reorder_point>2</reorder_point>"
766 " <reorder_quantity>10</reorder_quantity>";
767
768 int simdur = 2;
769
770 cyclus::MockSim sim(cyclus::AgentSpec(":cycamore:Storage"), config, simdur);
771
772 EXPECT_THROW(int id = sim.Run(), cyclus::ValueError);
773}
774
775TEST_F(StorageTest, RQ_Inventory) {
776 std::string config =
777 " <in_commods> <val>spent_fuel</val> </in_commods> "
778 " <out_commods> <val>dry_spent</val> </out_commods> "
779 " <max_inv_size>5</max_inv_size>"
780 " <reorder_point>2</reorder_point>"
781 " <reorder_quantity>3</reorder_quantity>";
782
783 int simdur = 5;
784
785 cyclus::MockSim sim(cyclus::AgentSpec (":cycamore:Storage"), config, simdur);
786
787 sim.AddSource("spent_fuel").capacity(5).Finalize();
788 sim.AddSink("dry_spent").Finalize();
789
790 int id = sim.Run();
791
792 std::vector<cyclus::Cond> conds;
793 conds.push_back(cyclus::Cond("Commodity", "==", std::string("spent_fuel")));
794 cyclus::QueryResult qr = sim.db().Query("Transactions", &conds);
795 int n_trans = qr.rows.size();
796
797 EXPECT_EQ(3, n_trans) << "expected 3 transactions, got " << n_trans;
798 // check that the transactions occur at the expected time (0, 2, 4)
799 EXPECT_EQ(0, qr.GetVal<int>("Time", 0));
800 EXPECT_EQ(2, qr.GetVal<int>("Time", 1));
801 EXPECT_EQ(4, qr.GetVal<int>("Time", 2));
802
803 // check that all transactions are of size 3
804 qr = sim.db().Query("Resources", NULL);
805 EXPECT_EQ(3, qr.GetVal<double>("Quantity", 0));
806}
807
808TEST_F(StorageTest, sS_Inventory) {
809 std::string config =
810 " <in_commods> <val>spent_fuel</val> </in_commods> "
811 " <out_commods> <val>dry_spent</val> </out_commods> "
812 " <max_inv_size>5</max_inv_size>"
813 " <reorder_point>2</reorder_point>";
814
815 int simdur = 5;
816
817 cyclus::MockSim sim(cyclus::AgentSpec (":cycamore:Storage"), config, simdur);
818
819 sim.AddSource("spent_fuel").capacity(5).Finalize();
820 sim.AddSink("dry_spent").Finalize();
821
822 int id = sim.Run();
823
824 std::vector<cyclus::Cond> conds;
825 conds.push_back(cyclus::Cond("Commodity", "==", std::string("spent_fuel")));
826 cyclus::QueryResult qr = sim.db().Query("Transactions", &conds);
827 int n_trans = qr.rows.size();
828 EXPECT_EQ(3, n_trans) << "expected 3 transactions, got " << n_trans;
829 // check that the transactions occur at the expected time (0, 2, 4)
830 EXPECT_EQ(0, qr.GetVal<int>("Time", 0));
831 EXPECT_EQ(2, qr.GetVal<int>("Time", 1));
832 EXPECT_EQ(4, qr.GetVal<int>("Time", 2));
833
834 // check that all transactions are of size 5
835 qr = sim.db().Query("Resources", NULL);
836 EXPECT_EQ(5, qr.GetVal<double>("Quantity", 0));
837}
838
839TEST_F(StorageTest, CCap_Inventory) {
840 std::string config =
841 " <in_commods> <val>spent_fuel</val> </in_commods> "
842 " <out_commods> <val>dry_spent</val> </out_commods> "
843 " <throughput>1</throughput> "
844 " <cumulative_cap>2</cumulative_cap> "
845 " <dormant_buying_frequency_type>Fixed</dormant_buying_frequency_type> "
846 " <dormant_buying_val>2</dormant_buying_val> ";
847
848 int simdur = 9;
849
850 cyclus::MockSim sim(cyclus::AgentSpec (":cycamore:Storage"), config, simdur);
851
852 sim.AddSource("spent_fuel").capacity(5).Finalize();
853 sim.AddSink("dry_spent").Finalize();
854
855 int id = sim.Run();
856
857 std::vector<cyclus::Cond> conds;
858 conds.push_back(cyclus::Cond("Commodity", "==", std::string("spent_fuel")));
859 cyclus::QueryResult qr = sim.db().Query("Transactions", &conds);
860 int n_trans = qr.rows.size();
861 EXPECT_EQ(5, n_trans) << "expected 5 transactions, got " << n_trans;
862 // check that the transactions occur at the expected time (0, 1, 4, 5, 8)
863 EXPECT_EQ(0, qr.GetVal<int>("Time", 0));
864 EXPECT_EQ(1, qr.GetVal<int>("Time", 1));
865 EXPECT_EQ(4, qr.GetVal<int>("Time", 2));
866 EXPECT_EQ(5, qr.GetVal<int>("Time", 3));
867 EXPECT_EQ(8, qr.GetVal<int>("Time", 4));
868
869 // check that transactions are of size 1
870 qr = sim.db().Query("Resources", NULL);
871 EXPECT_EQ(1, qr.GetVal<double>("Quantity", 0));
872 EXPECT_EQ(1, qr.GetVal<double>("Quantity", 4));
873}
874
875TEST_F(StorageTest, PackageExactly) {
876 // resource can be packaged without splitting or merging
877 std::string config =
878 " <in_commods> <val>spent_fuel</val> </in_commods> "
879 " <out_commods> <val>dry_spent</val> </out_commods> "
880 " <package>foo</package>";
881
882 int simdur = 3;
883
884 cyclus::MockSim sim(cyclus::AgentSpec (":cycamore:Storage"), config, simdur);
885 sim.context()->AddPackage("foo", 1, 2, "first");
886 cyclus::Package::Ptr p = sim.context()->GetPackage("foo");
887
888 sim.AddSource("spent_fuel").capacity(2).Finalize();
889 sim.AddSink("dry_spent").Finalize();
890
891 int id = sim.Run();
892
893 std::vector<cyclus::Cond> tr_conds;
894 tr_conds.push_back(cyclus::Cond("Commodity", "==", std::string("dry_spent")));
895 cyclus::QueryResult qr_trans = sim.db().Query("Transactions", &tr_conds);
896 // two transactions out of storage, happening at time 1 and 2
897 EXPECT_EQ(2, qr_trans.rows.size());
898
899 EXPECT_EQ(1, qr_trans.GetVal<int>("Time", 0));
900 EXPECT_EQ(2, qr_trans.GetVal<int>("Time", 1));
901
902 std::vector<cyclus::Cond> res_conds;
903 res_conds.push_back(cyclus::Cond("PackageName", "==", p->name()));
904 cyclus::QueryResult qr_res = sim.db().Query("Resources", &res_conds);
905 // two resources that have been packaged, each of size two
906 EXPECT_EQ(qr_res.rows.size(), 2);
907 EXPECT_EQ(qr_res.GetVal<double>("Quantity", 0), 2);
908 EXPECT_EQ(qr_res.GetVal<double>("Quantity", 1), 2);
909}
910
911TEST_F(StorageTest, PackageSplitEqual) {
912 // Resources must be split into two to package. Packaging strategy equal
913 std::string config =
914 " <in_commods> <val>commodity</val> </in_commods> "
915 " <out_commods> <val>commodity1</val> </out_commods> "
916 " <package>foo</package>";
917
918 int simdur = 3;
919
920 cyclus::MockSim sim(cyclus::AgentSpec (":cycamore:Storage"), config, simdur);
921 sim.context()->AddPackage("foo", 1, 2, "equal");
922 cyclus::Package::Ptr p = sim.context()->GetPackage("foo");
923
924 sim.AddSource("commodity").capacity(3).Finalize();
925 sim.AddSink("commodity1").Finalize();
926
927 int id = sim.Run();
928
929 std::vector<cyclus::Cond> tr_conds;
930 tr_conds.push_back(cyclus::Cond("Commodity", "==", std::string("commodity1")));
931 cyclus::QueryResult qr_trans = sim.db().Query("Transactions", &tr_conds);
932 // four transactions out of storage. Each resource is split, so two
933 // transactions at time 1, two at time 2
934 EXPECT_EQ(4, qr_trans.rows.size());
935
936 EXPECT_EQ(1, qr_trans.GetVal<int>("Time", 0));
937 EXPECT_EQ(1, qr_trans.GetVal<int>("Time", 1));
938 EXPECT_EQ(2, qr_trans.GetVal<int>("Time", 2));
939 EXPECT_EQ(2, qr_trans.GetVal<int>("Time", 3));
940
941 std::vector<cyclus::Cond> res_conds;
942 res_conds.push_back(cyclus::Cond("PackageName", "==", p->name()));
943 cyclus::QueryResult qr_res = sim.db().Query("Resources", &res_conds);
944 // because package does split-equally, resources are all of size 1.5 (3/2)
945 EXPECT_EQ(qr_res.rows.size(), 4);
946 EXPECT_EQ(1.5, qr_res.GetVal<double>("Quantity", 0));
947 EXPECT_EQ(1.5, qr_res.GetVal<double>("Quantity", 1));
948 EXPECT_EQ(1.5, qr_res.GetVal<double>("Quantity", 2));
949 EXPECT_EQ(1.5, qr_res.GetVal<double>("Quantity", 3));
950}
951
952TEST_F(StorageTest, PackageSplitFirst) {
953 // Resources must be split into two to package. Packaging strategy first
954 std::string config =
955 " <in_commods> <val>commodity</val> </in_commods> "
956 " <out_commods> <val>commodity1</val> </out_commods> "
957 " <package>foo</package>";
958
959 int simdur = 3;
960
961 cyclus::MockSim sim(cyclus::AgentSpec (":cycamore:Storage"), config, simdur);
962 sim.context()->AddPackage("foo", 1, 2, "first");
963 cyclus::Package::Ptr p = sim.context()->GetPackage("foo");
964
965 sim.AddSource("commodity").capacity(3).Finalize();
966 sim.AddSink("commodity1").Finalize();
967
968 int id = sim.Run();
969
970 std::vector<cyclus::Cond> tr_conds;
971 tr_conds.push_back(cyclus::Cond("Commodity", "==", std::string("commodity1")));
972 cyclus::QueryResult qr_trans = sim.db().Query("Transactions", &tr_conds);
973 // four transactions out of storage. Each resource is split, so two
974 // transactions at time 1, two at time 2
975 EXPECT_EQ(4, qr_trans.rows.size());
976
977 EXPECT_EQ(1, qr_trans.GetVal<int>("Time", 0));
978 EXPECT_EQ(1, qr_trans.GetVal<int>("Time", 1));
979 EXPECT_EQ(2, qr_trans.GetVal<int>("Time", 2));
980 EXPECT_EQ(2, qr_trans.GetVal<int>("Time", 3));
981
982 std::vector<cyclus::Cond> res_conds;
983 res_conds.push_back(cyclus::Cond("PackageName", "==", p->name()));
984 cyclus::QueryResult qr_res = sim.db().Query("Resources", &res_conds);
985 // because package does split-first, resources are size 2 and 1
986 EXPECT_EQ(qr_res.rows.size(), 4);
987
988 // order of trade execution is not guaranteed. Therefore, create vector,
989 // sort by size, and then check values
990 std::vector<double> pkgd_t0 = {qr_res.GetVal<double>("Quantity", 0),
991 qr_res.GetVal<double>("Quantity", 1)};
992 std::sort(pkgd_t0.begin(), pkgd_t0.end(), std::greater<double>());
993 std::vector<double> exp_t0 = {2, 1};
994
995 EXPECT_EQ(exp_t0, pkgd_t0);
996
997 std::vector<double> pkgd_t1 = {qr_res.GetVal<double>("Quantity", 2),
998 qr_res.GetVal<double>("Quantity", 3)};
999 std::sort(pkgd_t1.begin(), pkgd_t1.end(), std::greater<double>());
1000 std::vector<double> exp_t1 = {2, 1};
1001
1002 EXPECT_EQ(exp_t1, pkgd_t1);
1003}
1004
1005TEST_F(StorageTest, PackageMerge) {
1006 std::string config =
1007 " <in_commods> <val>commodity</val> </in_commods> "
1008 " <out_commods> <val>commodity1</val> </out_commods> "
1009 " <throughput>1</throughput> "
1010 " <package>foo</package>";
1011
1012 int simdur = 5;
1013
1014 cyclus::MockSim sim(cyclus::AgentSpec (":cycamore:Storage"), config, simdur);
1015 sim.context()->AddPackage("foo", 1, 2, "first");
1016 cyclus::Package::Ptr p = sim.context()->GetPackage("foo");
1017
1018 sim.AddSource("commodity").capacity(0.5).Finalize();
1019 sim.AddSink("commodity1").Finalize();
1020
1021 int id = sim.Run();
1022
1023 std::vector<cyclus::Cond> tr_conds;
1024 tr_conds.push_back(cyclus::Cond("Commodity", "==", std::string("commodity1")));
1025
1026 cyclus::QueryResult qr_trans = sim.db().Query("Transactions", &tr_conds);
1027 // two transactions out of storage. Because the source only provides 0.5 each
1028 // time step, it takes two time steps to acquire enough material to package.
1029 // Therefore transactions at time 2 and 4
1030 EXPECT_EQ(2, qr_trans.rows.size());
1031
1032 EXPECT_EQ(2, qr_trans.GetVal<int>("Time", 0));
1033 EXPECT_EQ(4, qr_trans.GetVal<int>("Time", 1));
1034
1035 std::vector<cyclus::Cond> res_conds;
1036 res_conds.push_back(cyclus::Cond("PackageName", "==", p->name()));
1037 cyclus::QueryResult qr_res = sim.db().Query("Resources", &res_conds);
1038 // Combines two 0.5 mass resources to make packages with mass 1
1039 EXPECT_EQ(2, qr_res.rows.size());
1040 EXPECT_EQ(1, qr_res.GetVal<double>("Quantity", 0));
1041 EXPECT_EQ(1, qr_res.GetVal<double>("Quantity", 1));
1042}
1043
1044TEST_F(StorageTest, TransportUnit) {
1045 std::string config =
1046 " <in_commods> <val>commodity</val> </in_commods> "
1047 " <out_commods> <val>commodity1</val> </out_commods> "
1048 " <throughput>3</throughput> "
1049 " <package>foo</package>"
1050 " <transport_unit>bar</transport_unit>";
1051
1052 int simdur = 3;
1053
1054 cyclus::MockSim sim(cyclus::AgentSpec (":cycamore:Storage"), config, simdur);
1055 sim.context()->AddPackage("foo", 1, 1, "first");
1056 cyclus::Package::Ptr p = sim.context()->GetPackage("foo");
1057 sim.context()->AddTransportUnit("bar", 2, 2, "first");
1058
1059 sim.AddSource("commodity").Finalize();
1060 sim.AddSink("commodity1").Finalize();
1061
1062 int id = sim.Run();
1063
1064 std::vector<cyclus::Cond> tr_conds;
1065 tr_conds.push_back(cyclus::Cond("Commodity", "==", std::string("commodity1")));
1066
1067 cyclus::QueryResult qr_trans = sim.db().Query("Transactions", &tr_conds);
1068 // 6 transactions. While all three units could be packaged in one time step,
1069 // the transport unit only allows two packages to be transported. Therefore,
1070 // zero transactions the first timestep (material coming to storage from
1071 // source). Then only two packages can be shipped at time step 1. Then the
1072 // two packages plus the leftover material is able to ship four packages,
1073 // two transport units in time 2
1074 EXPECT_EQ(6, qr_trans.rows.size());
1075
1076 EXPECT_EQ(1, qr_trans.GetVal<int>("Time", 0));
1077 EXPECT_EQ(1, qr_trans.GetVal<int>("Time", 1));
1078 EXPECT_EQ(2, qr_trans.GetVal<int>("Time", 2));
1079 EXPECT_EQ(2, qr_trans.GetVal<int>("Time", 3));
1080 EXPECT_EQ(2, qr_trans.GetVal<int>("Time", 4));
1081 EXPECT_EQ(2, qr_trans.GetVal<int>("Time", 5));
1082
1083 for (int i = 0; i < qr_trans.rows.size(); i++) {
1084 std::cerr << "transaction " << i << "is at time " << qr_trans.GetVal<int>("Time", i) << std::endl;
1085 }
1086
1087 std::vector<cyclus::Cond> res_conds;
1088 res_conds.push_back(cyclus::Cond("PackageName", "==", p->name()));
1089 cyclus::QueryResult qr_res = sim.db().Query("Resources", &res_conds);
1090 // All pkgd resources are size 1
1091 EXPECT_EQ(6, qr_res.rows.size());
1092
1093 EXPECT_EQ(1, qr_res.GetVal<double>("Quantity", 0));
1094 EXPECT_EQ(1, qr_res.GetVal<double>("Quantity", 5));
1095}
1096
1097} // namespace cycamore
1098
1099// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1100cyclus::Agent* StorageConstructor(cyclus::Context* ctx) {
1101 return new cycamore::Storage(ctx);
1102}
1103
1104// required to get functionality in cyclus agent unit tests library
1105#ifndef CYCLUS_AGENT_TESTS_CONNECTED
1108#define CYCLUS_AGENT_TESTS_CONNECTED cyclus_agent_tests_connected
1109#endif // CYCLUS_AGENT_TESTS_CONNECTED
1110
1111// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1112INSTANTIATE_TEST_SUITE_P(StorageFac, FacilityTests,
1113 ::testing::Values(&StorageConstructor));
1114
1115INSTANTIATE_TEST_SUITE_P(StorageFac, AgentTests,
1116 ::testing::Values(&StorageConstructor));
static int cyclus_agent_tests_connected
INSTANTIATE_TEST_SUITE_P(DeployInst, InstitutionTests, Values(&DeployInstitutionConstructor))
int ConnectAgentTests()
cyclus::Agent * StorageConstructor(cyclus::Context *ctx)
std::vector< std::string > out_c1
void TestInitState(cycamore::Storage *fac)
void TestBuffers(cycamore::Storage *fac, double inv, double proc, double ready, double stocks)
void TestReadyTime(cycamore::Storage *fac, int t)
std::vector< std::string > in_c1
void TestStocks(cycamore::Storage *fac, cyclus::CompMap v)
void TestCurrentCap(cycamore::Storage *fac, double inv)
void TestAddMat(cycamore::Storage *fac, cyclus::Material::Ptr mat)
This Facility is intended to hold materials for a user specified amount of time in order to model a s...
virtual std::string str()
A verbose printer for the Storage Facility.
cyclus::toolkit::TotalInvTracker inventory_tracker
virtual cyclus::Agent * Clone()
std::vector< std::string > in_commods
virtual void Tock()
The handleTick function specific to the Storage.
std::vector< std::string > out_commods
virtual void Tick()
The handleTick function specific to the Storage.
TEST_F(EnrichmentTest, RequestQty)