refactor add_agent
This commit is contained in:
1 parent
f9842f635b
commit
25af75b381
1 file changed
+3
-2
+3
-2
@@ -34,8 +34,9 @@ impl World {
|
||||
if p.is_some() {
|
||||
return Err("ERROR: pos занято");
|
||||
}
|
||||
self.agents.push(Arc::new(Mutex::new(ag)));
|
||||
*p = Some(Arc::clone(&self.agents[self.agents.len() -1]));
|
||||
let rec_ag = Arc::new(Mutex::new(ag));
|
||||
self.agents.push(Arc::clone(&rec_ag));
|
||||
*p = Some(Arc::clone(&rec_ag));
|
||||
Ok(())
|
||||
}
|
||||
pub fn get_grid(&self) -> &TorusGrid<bool>{
|
||||
|
||||
Reference in new issue
Block a user