|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
#include <random_net.H>
Public Member Functions | |
| Random_Network_Flow (const unsigned int seed=time(nullptr)) | |
| Random_Network_Flow (const Random_Network_Flow &)=delete | |
| Not copyable, nor movable: it owns its generator and its network. | |
| Random_Network_Flow & | operator= (const Random_Network_Flow &)=delete |
| Not assignable, as it is not copyable. | |
| Net * | operator() (const size_t num_ranks, const size_t num_nodes_by_rank, const double &rank_sigma=0.2, const double &cap_mean=100, const double &cap_sigma=0.9, const double &forward_density=0.3, const double &backward_density=0.01) |
| The number of nodes per rank is determined by a distribution normal with half num_nodes_by_rank and sigma deviation. | |
Private Types | |
| typedef Net::Node | Node |
| typedef Net::Arc | Arc |
Private Member Functions | |
| void | connect_ranks (size_t src_idx_rank, size_t tgt_idx_rank, const double &cap_mean, const double &cap_sigma, const double &density) |
| void | create_forward_arcs_in_rank (size_t curr_rank_idx, const double &cap_mean, const double &cap_sigma, const double &forward_density) |
| void | create_backward_arcs_in_rank (const size_t curr_rank_idx, const double &cap_mean, const double &cap_sigma, const double &backward_density) |
| void | create_ranks (const size_t num_ranks, const size_t num_nodes_by_rank, const double &rank_sigma) |
| void | create_arcs (const double &cap_mean, const double &cap_sigma, const double &forward_density, const double &backward_density) |
| After created ranks and their nodes, this routine creates the arcs. | |
Private Attributes | |
| DynArray< DynArray< Node * > > | rank |
| Aleph::Gsl_Compatible_Rng_Owner | r |
| std::unique_ptr< Net > | net |
Definition at line 62 of file random_net.H.
|
private |
Definition at line 65 of file random_net.H.
|
private |
Definition at line 64 of file random_net.H.
|
inline |
Definition at line 72 of file random_net.H.
|
delete |
Not copyable, nor movable: it owns its generator and its network.
|
inlineprivate |
Definition at line 85 of file random_net.H.
References Aleph::DynArray< T >::access(), arcs, Aleph::Gsl_Compatible_Rng::exponential(), Aleph::Gsl_Compatible_Rng::gaussian(), k, Random_Network_Flow< Net >::r, Random_Network_Flow< Net >::rank, Aleph::DynArray< T >::size(), and Aleph::Gsl_Compatible_Rng::uniform_int().
Referenced by Random_Network_Flow< Net >::create_backward_arcs_in_rank(), and Random_Network_Flow< Net >::create_forward_arcs_in_rank().
|
inlineprivate |
After created ranks and their nodes, this routine creates the arcs.
Forward arcs between a rank and another are randomly generated according an exponential with parameter forward_density*total_nodes. The arc capacity is generated according to a normal with mean cap_mean and deviation cap_sigma
Definition at line 162 of file random_net.H.
References ah_domain_error_if, Random_Network_Flow< Net >::create_backward_arcs_in_rank(), Random_Network_Flow< Net >::create_forward_arcs_in_rank(), and Random_Network_Flow< Net >::rank.
Referenced by Random_Network_Flow< Net >::operator()().
|
inlineprivate |
Definition at line 126 of file random_net.H.
References Random_Network_Flow< Net >::connect_ranks().
Referenced by Random_Network_Flow< Net >::create_arcs().
|
inlineprivate |
Definition at line 116 of file random_net.H.
References Random_Network_Flow< Net >::connect_ranks(), and Random_Network_Flow< Net >::rank.
Referenced by Random_Network_Flow< Net >::create_arcs().
|
inlineprivate |
Definition at line 138 of file random_net.H.
References Aleph::DynArray< T >::access(), ah_domain_error_if, Aleph::Gsl_Compatible_Rng::gaussian(), k, num_nodes, Random_Network_Flow< Net >::r, and Random_Network_Flow< Net >::rank.
Referenced by Random_Network_Flow< Net >::operator()().
|
inline |
The number of nodes per rank is determined by a distribution normal with half num_nodes_by_rank and sigma deviation.
The sigma deviation should be a value between 0 and 1. The value of sigma that joins for normal distribution will be rank_sigma*num_nodes_by_rank.
The capacities of the arches are selected according to a Normal distribution with mean cap_mean and deviation cap_sigma.
The arcs of advancement between one rank and another correspond to a Exponential distribution with parameter forward_density*num_nodes_by_rank.
| [in] | num_ranks | Number of ranks in the network |
| [in] | num_nodes_by_rank | Average number of nodes per rank |
| [in] | rank_sigma | Standard deviation of the number of nodes per rank (0-1) |
| [in] | cap_mean | Mean of the capacity of an arc |
| [in] | cap_sigma | Standard deviation of the capacity of an arc |
| [in] | forward_density | Density of the arcs from a rank to the next one, in (0, 1), and not less than backward_density |
| [in] | backward_density | Density of the arcs from a rank to the previous one, in (0, 1) |
Definition at line 217 of file random_net.H.
References Random_Network_Flow< Net >::create_arcs(), Random_Network_Flow< Net >::create_ranks(), Random_Network_Flow< Net >::rank, and Aleph::Net_Graph< NodeT, ArcT >::reset().
|
delete |
Not assignable, as it is not copyable.
|
private |
Definition at line 69 of file random_net.H.
|
private |
Definition at line 68 of file random_net.H.
Referenced by Random_Network_Flow< Net >::connect_ranks(), and Random_Network_Flow< Net >::create_ranks().