Skip to content

Commit e5bbbd7

Browse files
committed
Fix test and clippy regressions
1 parent 0830470 commit e5bbbd7

File tree

12 files changed

+34
-13
lines changed

12 files changed

+34
-13
lines changed

sim/src/input_modeling/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
77
pub mod random_variable;
88
pub mod thinning;
9-
pub mod uniform_rng;
9+
pub mod dynamic_rng;
1010

1111
pub use random_variable::Boolean as BooleanRandomVariable;
1212
pub use random_variable::Continuous as ContinuousRandomVariable;
1313
pub use random_variable::Discrete as DiscreteRandomVariable;
1414
pub use random_variable::Index as IndexRandomVariable;
1515
pub use thinning::Thinning;
16-
pub use uniform_rng::{dyn_rng, some_dyn_rng};
16+
pub use dynamic_rng::{dyn_rng, some_dyn_rng};

sim/src/input_modeling/random_variable.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use rand_distr::{Beta, Exp, Gamma, LogNormal, Normal, Triangular, Uniform, Weibu
1111
// Discrete distributions
1212
use rand_distr::{Bernoulli, Geometric, Poisson, WeightedIndex};
1313

14-
use super::uniform_rng::DynRng;
14+
use super::dynamic_rng::DynRng;
1515
use crate::utils::errors::SimulationError;
1616

1717
#[derive(Debug, Clone, Serialize, Deserialize)]
@@ -132,7 +132,7 @@ impl Index {
132132

133133
#[cfg(test)]
134134
mod tests {
135-
use crate::input_modeling::uniform_rng::default_rng;
135+
use crate::input_modeling::dynamic_rng::default_rng;
136136

137137
use super::*;
138138

sim/src/models/exclusive_gateway.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
44

55
use super::model_trait::{DevsModel, Reportable, ReportableModel, SerializableModel};
66
use super::{ModelMessage, ModelRecord};
7-
use crate::input_modeling::uniform_rng::DynRng;
7+
use crate::input_modeling::dynamic_rng::DynRng;
88
use crate::input_modeling::IndexRandomVariable;
99
use crate::simulator::Services;
1010
use crate::utils::errors::SimulationError;

sim/src/models/generator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use serde::{Deserialize, Serialize};
22

33
use super::model_trait::{DevsModel, Reportable, ReportableModel, SerializableModel};
44
use super::{ModelMessage, ModelRecord};
5-
use crate::input_modeling::uniform_rng::DynRng;
5+
use crate::input_modeling::dynamic_rng::DynRng;
66
use crate::input_modeling::ContinuousRandomVariable;
77
use crate::input_modeling::Thinning;
88
use crate::simulator::Services;

sim/src/models/processor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
44

55
use super::model_trait::{DevsModel, Reportable, ReportableModel, SerializableModel};
66
use super::{ModelMessage, ModelRecord};
7-
use crate::input_modeling::uniform_rng::DynRng;
7+
use crate::input_modeling::dynamic_rng::DynRng;
88
use crate::input_modeling::ContinuousRandomVariable;
99
use crate::simulator::Services;
1010
use crate::utils::errors::SimulationError;

sim/src/models/stochastic_gate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
44

55
use super::model_trait::{DevsModel, Reportable, ReportableModel, SerializableModel};
66
use super::{ModelMessage, ModelRecord};
7-
use crate::input_modeling::uniform_rng::DynRng;
7+
use crate::input_modeling::dynamic_rng::DynRng;
88
use crate::input_modeling::BooleanRandomVariable;
99
use crate::simulator::Services;
1010
use crate::utils::errors::SimulationError;

sim/src/simulator/mod.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@
1414
//! return the messages generated during the execution of the simulation
1515
//! step(s), for use in message analysis.
1616
17-
use std::cell::RefCell;
1817
use std::f64::INFINITY;
19-
use std::rc::Rc;
2018

2119
use serde::{Deserialize, Serialize};
2220

23-
use crate::input_modeling::uniform_rng::SimulationRng;
24-
use crate::input_modeling::{dyn_rng, some_dyn_rng};
21+
use crate::input_modeling::dynamic_rng::SimulationRng;
22+
use crate::input_modeling::dyn_rng;
2523
use crate::models::{DevsModel, Model, ModelMessage, ModelRecord, Reportable};
2624
use crate::utils::errors::SimulationError;
2725
use crate::utils::set_panic_hook;

sim/src/simulator/services.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use serde::{Deserialize, Serialize};
22

3-
use crate::input_modeling::uniform_rng::{default_rng, DynRng};
3+
use crate::input_modeling::dynamic_rng::{default_rng, DynRng};
44

55
/// The simulator provides a uniform random number generator and simulation
66
/// clock to models during the execution of a simulation

sim/tests/coupled.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ fn closure_under_coupling() -> Result<(), SimulationError> {
2020
None,
2121
String::from("job"),
2222
false,
23+
None,
2324
)),
2425
),
2526
Model::new(
@@ -30,6 +31,7 @@ fn closure_under_coupling() -> Result<(), SimulationError> {
3031
String::from("job"),
3132
String::from("processed"),
3233
false,
34+
None,
3335
)),
3436
),
3537
Model::new(
@@ -72,6 +74,7 @@ fn closure_under_coupling() -> Result<(), SimulationError> {
7274
None,
7375
String::from("job"),
7476
false,
77+
None,
7578
)),
7679
),
7780
Model::new(
@@ -82,6 +85,7 @@ fn closure_under_coupling() -> Result<(), SimulationError> {
8285
String::from("job"),
8386
String::from("processed"),
8487
false,
88+
None,
8589
)),
8690
),
8791
],

sim/tests/custom.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ fn step_n_with_custom_passive_model() -> Result<(), SimulationError> {
9595
None,
9696
String::from("job"),
9797
false,
98+
None,
9899
)),
99100
),
100101
Model::new(

sim/tests/simulations.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ fn poisson_generator_processor_with_capacity() -> Result<(), SimulationError> {
2626
None,
2727
String::from("job"),
2828
false,
29+
None,
2930
)),
3031
),
3132
Model::new(
@@ -36,6 +37,7 @@ fn poisson_generator_processor_with_capacity() -> Result<(), SimulationError> {
3637
String::from("job"),
3738
String::from("processed"),
3839
false,
40+
None,
3941
)),
4042
),
4143
Model::new(
@@ -136,6 +138,7 @@ fn step_until_activities() -> Result<(), SimulationError> {
136138
None,
137139
String::from("job"),
138140
false,
141+
None,
139142
)),
140143
),
141144
Model::new(
@@ -184,6 +187,7 @@ fn non_stationary_generation() -> Result<(), SimulationError> {
184187
None,
185188
String::from("job"),
186189
false,
190+
None,
187191
)),
188192
),
189193
Model::new(
@@ -194,6 +198,7 @@ fn non_stationary_generation() -> Result<(), SimulationError> {
194198
String::from("job"),
195199
String::from("processed"),
196200
false,
201+
None,
197202
)),
198203
),
199204
Model::new(
@@ -259,6 +264,7 @@ fn exclusive_gateway_proportions_chi_square() -> Result<(), SimulationError> {
259264
None,
260265
String::from("job"),
261266
false,
267+
None,
262268
)),
263269
),
264270
Model::new(
@@ -274,6 +280,7 @@ fn exclusive_gateway_proportions_chi_square() -> Result<(), SimulationError> {
274280
weights: vec![6, 3, 1],
275281
},
276282
false,
283+
None,
277284
)),
278285
),
279286
Model::new(
@@ -382,6 +389,7 @@ fn gate_blocking_proportions() -> Result<(), SimulationError> {
382389
None,
383390
String::from("job"),
384391
false,
392+
None,
385393
)),
386394
),
387395
Model::new(
@@ -391,6 +399,7 @@ fn gate_blocking_proportions() -> Result<(), SimulationError> {
391399
None,
392400
String::from("job"),
393401
false,
402+
None,
394403
)),
395404
),
396405
Model::new(
@@ -400,6 +409,7 @@ fn gate_blocking_proportions() -> Result<(), SimulationError> {
400409
None,
401410
String::from("job"),
402411
false,
412+
None,
403413
)),
404414
),
405415
Model::new(
@@ -496,6 +506,7 @@ fn load_balancer_round_robin_outputs() -> Result<(), SimulationError> {
496506
None,
497507
String::from("job"),
498508
false,
509+
None,
499510
)),
500511
),
501512
Model::new(
@@ -676,6 +687,7 @@ fn parallel_gateway_splits_and_joins() -> Result<(), SimulationError> {
676687
None,
677688
String::from("job"),
678689
false,
690+
None,
679691
)),
680692
),
681693
Model::new(
@@ -784,6 +796,7 @@ fn match_status_reporting() -> Result<(), SimulationError> {
784796
None,
785797
String::from("job"),
786798
false,
799+
None,
787800
)),
788801
),
789802
Model::new(
@@ -819,6 +832,7 @@ fn stochastic_gate_blocking() -> Result<(), SimulationError> {
819832
None,
820833
String::from("job"),
821834
false,
835+
None,
822836
)),
823837
),
824838
Model::new(
@@ -828,6 +842,7 @@ fn stochastic_gate_blocking() -> Result<(), SimulationError> {
828842
String::from("job"),
829843
String::from("job"),
830844
false,
845+
None,
831846
)),
832847
),
833848
Model::new(
@@ -887,6 +902,7 @@ fn batch_sizing() -> Result<(), SimulationError> {
887902
None,
888903
String::from("job"),
889904
false,
905+
None,
890906
)),
891907
),
892908
Model::new(
@@ -957,6 +973,7 @@ fn min_and_max_stopwatch() -> Result<(), SimulationError> {
957973
None,
958974
String::from("job"),
959975
false,
976+
None,
960977
)),
961978
),
962979
Model::new(
@@ -967,6 +984,7 @@ fn min_and_max_stopwatch() -> Result<(), SimulationError> {
967984
String::from("job"),
968985
String::from("processed"),
969986
false,
987+
None,
970988
)),
971989
),
972990
Model::new(

0 commit comments

Comments
 (0)