|
@@ -59,7 +59,10 @@ pub struct User {
|
|
|
// Does the user submit reports to Troll Patrol?
|
|
|
submits_reports: bool,
|
|
|
|
|
|
- // How likely is this user to use bridges on a given day?
|
|
|
+ // How likely is this user to use bridges on a given day? This has
|
|
|
+ // been converted to a global parameter (prob_user_connects), but we
|
|
|
+ // still leave the user implementation for now in case we want to
|
|
|
+ // switch back to it.
|
|
|
prob_use_bridges: f64,
|
|
|
|
|
|
// If the censor implements partial blocking, is the user blocked?
|
|
@@ -90,8 +93,8 @@ impl User {
|
|
|
let (prob_use_bridges, submits_reports) = if is_censor {
|
|
|
(0.0, false)
|
|
|
} else {
|
|
|
- let mut rng = rand::thread_rng();
|
|
|
- let prob_use_bridges = rng.gen_range(0.0..=1.0);
|
|
|
+ // Use global value
|
|
|
+ let prob_use_bridges = config.prob_user_connects;
|
|
|
let submits_reports = event_happens(config.prob_user_submits_reports);
|
|
|
(prob_use_bridges, submits_reports)
|
|
|
};
|
|
@@ -198,8 +201,8 @@ impl User {
|
|
|
let (prob_use_bridges, submits_reports) = if is_censor {
|
|
|
(0.0, false)
|
|
|
} else {
|
|
|
- let mut rng = rand::thread_rng();
|
|
|
- let prob_use_bridges = rng.gen_range(0.0..=1.0);
|
|
|
+ // Use global value
|
|
|
+ let prob_use_bridges = config.prob_user_connects;
|
|
|
let submits_reports = event_happens(config.prob_user_submits_reports);
|
|
|
(prob_use_bridges, submits_reports)
|
|
|
};
|