From 8c2e9f37ebf5896af07a002e8689ba8b65d62a9c Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Mon, 9 Nov 2026 23:44:00 -0500 Subject: [PATCH] robot amount from toml --- simulator/src/main.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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())); }