![]() |
Vcsn
2.8
Be Rational
|
Abstract class for random weight generation. More...
#include <weightset.hh>
Public Types | |
using | weightset_t = WeightSet |
using | weight_t = typename weightset_t::value_t |
using | random_generator_t = RandomGenerator |
Public Member Functions | |
random_weight_base (random_generator_t &gen, const weightset_t &ws) | |
void | parse_param (const std::string ¶m) |
weight_t | generate_random_weight () const |
Protected Types | |
using | weight_map_t = std::map< weight_t, float, vcsn::less< weightset_t > > |
Elements given by the user and their associated probabilities (weight_weight_). More... | |
using | weight_weight_t = std::vector< float > |
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 | |
random_generator_t & | gen_ |
weightset_t | ws_ |
weight_t | min_ |
The min and the max given by the user. More... | |
weight_t | max_ |
weight_map_t | weight_ |
weight_weight_t | weight_weight_ |
discrete_chooser< random_generator_t > | 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 118 of file weightset.hh.
using vcsn::detail::random_weight_base< WeightSet, RandomGenerator >::random_generator_t = RandomGenerator |
Definition at line 123 of file weightset.hh.
|
protected |
Elements given by the user and their associated probabilities (weight_weight_).
Definition at line 198 of file weightset.hh.
using vcsn::detail::random_weight_base< WeightSet, RandomGenerator >::weight_t = typename weightset_t::value_t |
Definition at line 122 of file weightset.hh.
|
protected |
Definition at line 200 of file weightset.hh.
using vcsn::detail::random_weight_base< WeightSet, RandomGenerator >::weightset_t = WeightSet |
Definition at line 121 of file weightset.hh.
|
inline |
Definition at line 125 of file weightset.hh.
|
inline |
Definition at line 138 of file weightset.hh.
|
inline |
Definition at line 132 of file weightset.hh.
|
inlineprotectedvirtual |
Definition at line 144 of file weightset.hh.
|
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 >.
|
inlineprotected |
A random weight.
There is a biased probability to choose a value specified on the parameters.
Otherwise, choose a random value from the WeightSet.
Definition at line 174 of file weightset.hh.
|
protected |
Definition at line 202 of file weightset.hh.
|
protected |
Definition at line 190 of file weightset.hh.
|
protected |
Definition at line 195 of file weightset.hh.
|
protected |
The min and the max given by the user.
If unspecified, then it takes the min and max of the weighset by default.
Definition at line 194 of file weightset.hh.
|
protected |
Definition at line 199 of file weightset.hh.
|
protected |
Definition at line 201 of file weightset.hh.
|
protected |
Definition at line 191 of file weightset.hh.