You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
472 B
16 lines
472 B
pub mod agent;
|
|
pub mod view;
|
|
pub mod world;
|
|
|
|
use agent::{Agent, SimpleAgent};
|
|
use world::ActualWorld;
|
|
|
|
pub fn get_world(width: isize, height: isize, spacing: usize, validating: bool) -> ActualWorld {
|
|
let mut agents: Vec<(_, Box<dyn Agent>)> = vec![];
|
|
for x in (0..width).step_by(spacing) {
|
|
for y in (0..height).step_by(spacing) {
|
|
agents.push(((x, y).into(), Box::new(SimpleAgent)));
|
|
}
|
|
}
|
|
ActualWorld::new((width, height).into(), agents, validating)
|
|
}
|