semi functioning pheremone sim

This commit is contained in:
2024-01-07 20:19:52 -07:00
parent 47c6eff011
commit 823b5d39b8
8 changed files with 257 additions and 247 deletions
+4 -4
View File
@@ -23,15 +23,15 @@ fn test_reach_astar() {
let a = entities.data.get_mut(&id).unwrap();
let ant: &mut Ant = a.downcast_mut::<Ant>().unwrap();
ant.plan.push(AIGoal::Reach(Point(0, 0)));
/*ant.plan.push(AIGoal::Reach(Point(0, 0)));
ant.plan.push(AIGoal::Reach(Point(20, 20)));
ant.plan.push(AIGoal::Reach(Point(0, 0)));
ant.plan.push(AIGoal::Reach(Point(20, 20)));
ant.plan.push(AIGoal::Reach(Point(20, 20)));*/
// craps out... need to make sure unwrap() is safe
for _ in 0..420 {
for t in 0..420 {
// TODO: add way to break out of the loop by hitting a random key
simulate(&mut entities, &mut world, &mut board);
simulate(&mut entities, &mut world, &mut board, t);
render(&entities, &world, &board);
sleep(time::Duration::from_millis(100));
refresh();
+2 -2
View File
@@ -15,9 +15,9 @@ fn test_foodgen() {
let fg = FoodGenerator::new();
entities.add_entity(&fg);
for _ in 0..60 {
for t in 0..60 {
// TODO: add way to break out of the loop by hitting a random key
simulate(&mut entities, &mut world, &mut board);
simulate(&mut entities, &mut world, &mut board, t);
render(&entities, &world, &board);
sleep(time::Duration::from_millis(100));
refresh();