diff --git a/simulator/src/main.rs b/simulator/src/main.rs index 8d54387..019754b 100644 --- a/simulator/src/main.rs +++ b/simulator/src/main.rs @@ -45,7 +45,6 @@ struct Robot { pose: Pose, alive: AtomicBool, collider: Ball, - sensor: Sensor, team: Color, policy: Policy, } @@ -73,7 +72,7 @@ impl Mortal for Robot { impl Robot { fn new(pose: Pose, team: Color, policy: Policy) -> Self { - Self { pose, alive: AtomicBool::new(true), collider: Ball::new(BOT_RADIUS), sensor: Sensor::None, team, policy} + Self { pose, alive: AtomicBool::new(true), collider: Ball::new(BOT_RADIUS), team, policy} } fn move_step(&mut self, forward_right: [f32;2]) { @@ -223,16 +222,16 @@ impl Simulation { let angle = Uniform::new(0.0, TAU).unwrap(); // blue robots - for i in 5..20 { + for i in 0..config.blu_count { let rand_angle = angle.sample(&mut rng); - let pose:Pose = Pose::from_parts(Vec2 { x: 100.0, y: i as f32*50.0 }, Rot2::from_angle(rand_angle)); + let pose:Pose = Pose::from_parts(Vec2 { x: 100.0, y: i as f32*50.0 + 250.0}, Rot2::from_angle(rand_angle)); robots.push(Robot::new(pose, BLUE, config.blu_policy.clone())); } //red robots - for i in 5..20 { + for i in 0..config.red_count { let rand_angle = angle.sample(&mut rng); - let pose:Pose = Pose::from_parts(Vec2 { x: 1200.0, y: i as f32*50.0 }, Rot2::from_angle(rand_angle)); + let pose:Pose = Pose::from_parts(Vec2 { x: 1200.0, y: i as f32*50.0 + 250.0}, Rot2::from_angle(rand_angle)); robots.push(Robot::new(pose, RED, config.red_policy.clone())); }