npc_engine_utils/
lib.rs

1/*
2 *  SPDX-License-Identifier: Apache-2.0 OR MIT
3 *  © 2020-2022 ETH Zurich and other contributors, see AUTHORS.txt for details
4 */
5
6//! This is the utility module of the [NPC engine](https://crates.io/crates/npc-engine-core/), containing helpful utility code.
7//!
8//! It contains the following features:
9//! - A helper trait [OptionDiffDomain] that can be used when [Diffs](Domain::Diff) are just copies of the [State](Domain::State).
10//! - Two executors (update loops), [SimpleExecutor] and [ThreadedExecutor], that implement the execution logic of a [Domain] beyond planning itself, and related abstractions.
11//! - A simple implementation of feed-forward leaky ReLU neurons ([Neuron]) and corresponding simple networks ([NeuralNetwork]), providing learning based on back-propagation ([NeuralNetwork::train]).
12//! - Simple 2-D coordinates ([Coord2D]) and direction ([Direction]) implementations.
13//! - Helper functions to plot search trees: [plot_tree_in_tmp] and [plot_tree_in_tmp_with_task_name].
14//! - Helper functions to simplify functional programming with tuples: [keep_first] and [keep_second], and their mutable versions [keep_first_mut] and [keep_second_mut].
15
16#[cfg(doc)]
17use npc_engine_core::Domain;
18
19mod coord2d;
20mod direction;
21mod executor;
22mod functional;
23mod global_domain;
24mod graphs;
25mod neuron;
26mod option_state_diff;
27
28pub use coord2d::*;
29pub use direction::*;
30pub use executor::*;
31pub use functional::*;
32pub use global_domain::*;
33pub use graphs::*;
34pub use neuron::*;
35pub use option_state_diff::*;