Crate npc_engine_utils

Source
Expand description

This is the utility module of the NPC engine, containing helpful utility code.

It contains the following features:

Structs§

Coord2D
A 2-D integer coordinate type.
DirectionConverter
A helper struct to apply direction to coordinates.
NeuralNetwork
A simple neural network with I inputs and one hidden layer of H neurons.
Neuron
A simple leaky ReLU neuron with I inputs.
SimpleExecutor
A single-threaded generic executor.
ThreadedExecutor
A multi-threaded generic executor.
YDown
Down is positive.
YUp
Up is positive.

Enums§

Direction
A direction type.

Constants§

DIRECTIONS
All directions.

Traits§

ExecutableDomain
A domain for which we can run a generic executor.
ExecutorState
User-defined methods for the executor.
ExecutorStateGlobal
User-defined methods for the executor, where world and planner states are different.
ExecutorStateLocal
User-defined methods for the executor, where world and planner states are similar.
GlobalDomain
A domain that provides a global state, out of which a local state for the planning can be derived.
OptionDiffDomain
In case your domain has a Diff that is an Option of its State, provides helper functions to retrieve the state in your tasks.
YUpDown
A helper trait that tells whether up and down are positive or negative.

Functions§

keep_first
Returns a reference to the first element of a tuple reference.
keep_first_mut
Returns a mutable reference to the first element of a mutable tuple reference.
keep_second
Returns a reference to the second element of a tuple reference.
keep_second_mut
Returns a mutable reference to the second element of a mutable tuple reference.
plot_tree_in_tmp
Plots the MCTS tree using graphviz’s dot format.
plot_tree_in_tmp_with_task_name
Plots the MCTS tree using graphviz’s dot format, with a filename derived from an active task.
run_simple_executor
Creates and runs a single-threaded executor, initializes state and task queue from the S trait.
run_threaded_executor
Creates and runs a multi-threaded executor, initializes state and task queue from the S trait.

Type Aliases§

DirectionConverterYDown
Apply direction to coordinates with up being negative.
DirectionConverterYUp
Apply direction to coordinates with up being positive.