silence spammy logs

This commit is contained in:
Dustin Carlino 2018-08-28 14:47:49 -07:00
parent c9a0ea213b
commit fc2abb1524
3 changed files with 31 additions and 17 deletions

View File

@ -111,11 +111,15 @@ fn make_turns(
) -> Vec<Turn> {
// TODO: Figure out why this happens in the huge map
if incoming.is_empty() {
println!("WARNING: {} has no incoming lanes of some type", parent);
if false {
println!("WARNING: {} has no incoming lanes of some type", parent);
}
return Vec::new();
}
if outgoing.is_empty() {
println!("WARNING: {} has no outgoing lanes of some type", parent);
if false {
println!("WARNING: {} has no outgoing lanes of some type", parent);
}
return Vec::new();
}

View File

@ -666,12 +666,14 @@ impl DrivingSimState {
{
let other_dist = self.cars[&other].dist_along;
if other_dist >= dist_along {
println!(
"{} can't spawn, because they'd wind up too close ({}) behind {}",
car,
other_dist - dist_along,
other
);
if false {
println!(
"{} can't spawn, because they'd wind up too close ({}) behind {}",
car,
other_dist - dist_along,
other
);
}
return false;
}
@ -684,7 +686,9 @@ impl DrivingSimState {
0.0 * si::MPS,
);
if accel_for_other_to_stop <= other_vehicle.max_deaccel {
println!("{} can't spawn {} in front of {}, because {} would have to do {} to not hit {}", car, dist_along - other_dist, other, other, accel_for_other_to_stop, car);
if false {
println!("{} can't spawn {} in front of {}, because {} would have to do {} to not hit {}", car, dist_along - other_dist, other, other, accel_for_other_to_stop, car);
}
return false;
}

View File

@ -141,18 +141,20 @@ impl Spawner {
spawned_agents += 1;
}
};
} else {
} else if false {
println!(
"Couldn't find path from {} to {} for {:?}",
req.0, req.1, cmd
);
}
}
println!(
"Spawned {} agents of requested {}",
spawned_agents,
requested_paths.len()
);
if false {
println!(
"Spawned {} agents of requested {}",
spawned_agents,
requested_paths.len()
);
}
}
// This happens immediately; it isn't scheduled.
@ -477,7 +479,9 @@ fn pick_ped_goal<R: Rng + ?Sized>(rng: &mut R, map: &Map, start: LaneID) -> Buil
fn calculate_paths(requested_paths: &Vec<(LaneID, LaneID)>, map: &Map) -> Vec<Option<Vec<LaneID>>> {
use rayon::prelude::*;
println!("Calculating {} paths", requested_paths.len());
if false {
println!("Calculating {} paths", requested_paths.len())
};
// TODO better timer macro
let timer = Instant::now();
let paths: Vec<Option<Vec<LaneID>>> = requested_paths
@ -487,7 +491,9 @@ fn calculate_paths(requested_paths: &Vec<(LaneID, LaneID)>, map: &Map) -> Vec<Op
let elapsed = timer.elapsed();
let dt = elapsed.as_secs() as f64 + f64::from(elapsed.subsec_nanos()) * 1e-9;
println!("Calculating {} paths took {}s", paths.len(), dt,);
if false {
println!("Calculating {} paths took {}s", paths.len(), dt)
};
paths
}