1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* SPDX-License-Identifier: Apache-2.0 OR MIT
* © 2020-2022 ETH Zurich and other contributors, see AUTHORS.txt for details
*/
//! This is the core of the NPC engine, containing the [MCTS] algorithm implementation and related abstractions.
//!
//! We provide several [examples](https://github.com/ethz-gtc/npc-engine/tree/main/npc-engine-core/examples)
//! as introductions on how to use the planner.
//! A good place to start is [tic-tac-toe](https://github.com/ethz-gtc/npc-engine/tree/main/npc-engine-core/examples/tic-tac-toe).
//!
//! The core of the planner is the [MCTS] struct, which holds the state of the planner.
//! It has two constructors, a simplified one, [new](MCTS::new), and a complete one, [new_with_tasks](MCTS::new_with_tasks).
//! Once constructed, the [run](MCTS::run) method performs the search and returns the best task.
//! After a search, the resulting tree can be inspected, starting from the [root node](MCTS::root_node).
//!
//! The [MCTS] struct is generic over a [Domain], which you have to implement to describe your own planning domain.
//! You need to implement at least these three methods:
//! * [list_behaviors](Domain::list_behaviors) returns the possible actions employing a hierarchical [Behavior] abstraction.
//! * [get_current_value](Domain::get_current_value) returns the instantaneous (not discounted) value of an agent in a given state.
//! * [update_visible_agents](Domain::update_visible_agents) lists all agents visible from a given agent in a given state.
//!
//! The `graphviz` feature enables to output the search tree in the Graphviz's dot format using the [plot_mcts_tree](graphviz::plot_mcts_tree) function.
//!
//! Additional features and utilites such as execution loops are available in the [`npc-engine-utils`](https://crates.io/crates/npc-engine-utils/) crate.
//! You might want to use them in your project as they make the planner significantly simpler to use.
//! Most [examples](https://github.com/ethz-gtc/npc-engine/tree/main/npc-engine-core/examples) use them.
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
use *;
/// The identifier of an agent, essentially a u32.
;