semi functioning pheremone sim
This commit is contained in:
+4
-4
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user