Module subtr_actor::ndarray

source ·

Macros

  • This macro creates a global FeatureAdder struct and implements the necessary traits to add the calculated features to the data matrix. The macro exports a struct with the same name as passed in the parameter. The number of column names and the length of the feature array returned by $prop_getter are checked at compile time to ensure they match, in line with the LengthCheckedFeatureAdder trait. The output struct also provides an implementation of the FeatureAdder trait via the impl_feature_adder! macro, allowing it to be used in contexts where a FeatureAdder object is required.
  • This macro creates a player feature adder struct and implements the necessary traits to add the calculated player-specific features to the data matrix. The macro exports a struct with the same name as passed in the parameter. The number of column names and the length of the feature array returned by $prop_getter are checked at compile time to ensure they match, in line with the LengthCheckedPlayerFeatureAdder trait. The output struct also provides an implementation of the PlayerFeatureAdder trait via the impl_player_feature_adder! macro, allowing it to be used in contexts where a PlayerFeatureAdder object is required.
  • A macro that tries to convert each provided item into a type. If any of the conversions fail, it short-circuits and returns the error.
  • A convenience macro that uses the convert_all macro with the convert_float_conversion_error function for error handling.
  • This macro is used to implement necessary traits for an existing struct to add the calculated features to the data matrix. This macro is particularly useful when the feature adder needs to be instantiated with specific parameters. The number of column names and the length of the feature array returned by $prop_getter are checked at compile time to ensure they match.
  • A macro to provide an automatic implementation of the FeatureAdder trait for types that implement LengthCheckedFeatureAdder. This allows you to take advantage of the compile-time guarantees provided by LengthCheckedFeatureAdder, while still being able to use your type in contexts that require a FeatureAdder object. This macro is used to bridge the gap between the two traits, as Rust’s type system does not currently provide a way to prove to the compiler that there will always be exactly one implementation of LengthCheckedFeatureAdder for each type.
  • A macro to provide an automatic implementation of the PlayerFeatureAdder trait for types that implement LengthCheckedPlayerFeatureAdder. This allows you to take advantage of the compile-time guarantees provided by LengthCheckedPlayerFeatureAdder, while still being able to use your type in contexts that require a PlayerFeatureAdder object. This macro is used to bridge the gap between the two traits, as Rust’s type system does not currently provide a way to prove to the compiler that there will always be exactly one implementation of LengthCheckedPlayerFeatureAdder for each type.
  • This macro is used to implement necessary traits for an existing struct to add the calculated player-specific features to the data matrix. This macro is particularly useful when the feature adder needs to be instantiated with specific parameters. The number of column names and the length of the feature array returned by $prop_getter are checked at compile time to ensure they match.

Structs

Statics

Traits

  • This trait acts as an abstraction over a feature adder, and is primarily used to allow for heterogeneous collections of feature adders in the NDArrayCollector. While it provides methods for adding features and retrieving column headers, it is generally recommended to implement the LengthCheckedFeatureAdder trait instead, which provides compile-time guarantees about the number of features returned.
  • This trait is stricter version of the FeatureAdder trait, enforcing at compile time that the number of features added is equal to the number of column headers provided. Implementations of this trait can be automatically adapted to the FeatureAdder trait using the impl_feature_adder! macro.
  • This trait is a more strict version of the PlayerFeatureAdder trait, enforcing at compile time that the number of player-specific features added is equal to the number of column headers provided. Implementations of this trait can be automatically adapted to the PlayerFeatureAdder trait using the impl_player_feature_adder! macro.
  • This trait acts as an abstraction over a player-specific feature adder, and is primarily used to allow for heterogeneous collections of player feature adders in the NDArrayCollector. While it provides methods for adding player-specific features and retrieving column headers, it is generally recommended to implement the LengthCheckedPlayerFeatureAdder trait instead, which provides compile-time guarantees about the number of features returned.

Functions