Vcsn
2.4
Be Rational
|
Abstract class for random weight generation. More...
#include <weightset.hh>
Public Types | |
using | weight_weight_t = std::vector< float > |
using | weight_map_t = std::map< typename WeightSet::value_t, float, vcsn::less< WeightSet >> |
using | randomGenerator_t = RandomGenerator |
using | weight_t = typename WeightSet::value_t |
Public Member Functions | |
random_weight_base (RandomGenerator &gen, const WeightSet &ws) | |
void | parse_param (const std::string ¶m) |
weight_t | generate_random_weight () const |
Protected Member Functions | |
virtual void | parse_param_ (const std::string &weights) |
virtual weight_t | pick_value_ () const =0 |
weight_t | print_random_weight_ () const |
A random weight. More... | |
Protected Attributes | |
WeightSet | ws_ |
weight_t | min_ |
The min and the max given by the user. More... | |
weight_t | max_ |
RandomGenerator & | gen_ |
weight_map_t | weight_ |
Elements given by the user and their associated probabilities (weight_weight_). More... | |
weight_weight_t | weight_weight_ |
discrete_chooser< RandomGenerator > | chooser_it_ {gen_} |
Abstract class for random weight generation.
It contains the parsing of the arguments (which can be overridden), the map of probabilities, the min and the max.
Definition at line 112 of file weightset.hh.
using vcsn::detail::random_weight_base< WeightSet, RandomGenerator >::randomGenerator_t = RandomGenerator |
Definition at line 118 of file weightset.hh.
using vcsn::detail::random_weight_base< WeightSet, RandomGenerator >::weight_map_t = std::map<typename WeightSet::value_t, float, vcsn::less<WeightSet>> |
Definition at line 117 of file weightset.hh.
using vcsn::detail::random_weight_base< WeightSet, RandomGenerator >::weight_t = typename WeightSet::value_t |
Definition at line 119 of file weightset.hh.
using vcsn::detail::random_weight_base< WeightSet, RandomGenerator >::weight_weight_t = std::vector<float> |
Definition at line 115 of file weightset.hh.
|
inline |
Definition at line 121 of file weightset.hh.
|
inline |
Definition at line 134 of file weightset.hh.
|
inline |
Definition at line 128 of file weightset.hh.
|
inlineprotectedvirtual |
Definition at line 140 of file weightset.hh.
Referenced by vcsn::detail::random_weight_base< zmin, RandomGenerator >::parse_param().
|
protectedpure virtual |
Implemented in vcsn::detail::random_weight< q, RandomGenerator >, vcsn::detail::random_weight< r, RandomGenerator >, vcsn::detail::random_weight< qmp, RandomGenerator >, vcsn::detail::random_weight< b, RandomGenerator >, vcsn::detail::random_weight< z, RandomGenerator >, vcsn::detail::random_weight< log, RandomGenerator >, vcsn::detail::random_weight< f2, RandomGenerator >, vcsn::detail::random_weight< rmin, RandomGenerator >, vcsn::detail::random_weight< nmin, RandomGenerator >, and vcsn::detail::random_weight< zmin, RandomGenerator >.
Referenced by vcsn::detail::random_weight_base< zmin, RandomGenerator >::print_random_weight_().
|
inlineprotected |
A random weight.
There is a probability to choose a value specified on the parameters.
If not, then choose a random value from the WeightSet.
Definition at line 172 of file weightset.hh.
Referenced by vcsn::detail::random_weight_base< zmin, RandomGenerator >::generate_random_weight().
|
protected |
Definition at line 199 of file weightset.hh.
Referenced by vcsn::detail::random_weight_base< zmin, RandomGenerator >::print_random_weight_().
|
protected |
Definition at line 194 of file weightset.hh.
Referenced by vcsn::detail::random_weight_base< zmin, RandomGenerator >::print_random_weight_().
|
protected |
Definition at line 193 of file weightset.hh.
Referenced by vcsn::detail::random_weight_base< zmin, RandomGenerator >::parse_param_().
|
protected |
The min and the max given by the user.
If not precised, then it takes the min and max of the weighset by default.
Definition at line 192 of file weightset.hh.
Referenced by vcsn::detail::random_weight_base< zmin, RandomGenerator >::parse_param_().
|
protected |
Elements given by the user and their associated probabilities (weight_weight_).
Definition at line 197 of file weightset.hh.
Referenced by vcsn::detail::random_weight_base< zmin, RandomGenerator >::parse_param_(), and vcsn::detail::random_weight_base< zmin, RandomGenerator >::print_random_weight_().
|
protected |
Definition at line 198 of file weightset.hh.
Referenced by vcsn::detail::random_weight_base< zmin, RandomGenerator >::parse_param_(), and vcsn::detail::random_weight_base< zmin, RandomGenerator >::print_random_weight_().
|
protected |
Definition at line 188 of file weightset.hh.
Referenced by vcsn::detail::random_weight_base< zmin, RandomGenerator >::parse_param_().