feat: ai strategy (wip)
This commit is contained in:
parent
899a690869
commit
ab770f3a34
14 changed files with 421 additions and 57 deletions
|
|
@ -1,4 +1,4 @@
|
|||
use bot::{BotStrategy, DefaultStrategy};
|
||||
use bot::{BotStrategy, DefaultStrategy, StableBaselines3Strategy};
|
||||
use itertools::Itertools;
|
||||
|
||||
use crate::game_runner::GameRunner;
|
||||
|
|
@ -32,6 +32,13 @@ impl App {
|
|||
"dummy" => {
|
||||
Some(Box::new(DefaultStrategy::default()) as Box<dyn BotStrategy>)
|
||||
}
|
||||
"ai" => {
|
||||
Some(Box::new(StableBaselines3Strategy::default()) as Box<dyn BotStrategy>)
|
||||
}
|
||||
s if s.starts_with("ai:") => {
|
||||
let path = s.trim_start_matches("ai:");
|
||||
Some(Box::new(StableBaselines3Strategy::new(path)) as Box<dyn BotStrategy>)
|
||||
}
|
||||
_ => None,
|
||||
})
|
||||
.collect()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue