![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Classes | |
| class | LayeredNetworkGenerator |
| A random lqn::LqnBuilder<T> source, configured once and then drawn from. More... | |
| class | NetworkGenerator |
| A random qn::Network<T> source, configured once and then drawn from. More... | |
| struct | Range |
| A closed interval the generator samples from. More... | |
Enumerations | |
| enum class | TopologyKind { Rand , Cyclic } |
| The two topology generators the reference ships, randGraph and cyclicGraph. More... | |
Functions | |
| Matrix< double > | rand_spanning_tree (std::size_t num_vertices, rng::JavaRandom &r) |
| randSpanningTree(n): vertex i (i >= 1) is attached to a uniformly chosen earlier vertex, which is a uniform draw over the labelled rooted trees this construction reaches, and always a tree rooted at 0. | |
| Matrix< double > | rand_graph (std::size_t num_vertices, rng::JavaRandom &r) |
| randGraph(n): a random strongly connected digraph on n vertices, as a random spanning tree closed up by strongConnect and then relabelled by a random permutation (without which vertex 0 would always be the DFS root). | |
| Matrix< double > | cyclic_graph (std::size_t num_vertices) |
| cyclicGraph(n): the single cycle 0 -> 1 -> ... -> n-1 -> 0. | |
| std::vector< double > | randfixedsumone (std::size_t num_elems, rng::JavaRandom &r) |
| randfixedsumone(n): n probabilities summing to exactly 1. | |
| std::vector< int > | randintfixedsum (int s, int n, rng::JavaRandom &r) |
| randintfixedsum(s, n): n STRICTLY POSITIVE integers summing to s. | |
|
strong |
The two topology generators the reference ships, randGraph and cyclicGraph.
| Enumerator | |
|---|---|
| Rand | |
| Cyclic | |
Definition at line 92 of file network_generator.h.
|
inline |
cyclicGraph(n): the single cycle 0 -> 1 -> ... -> n-1 -> 0.
Definition at line 197 of file network_generator.h.
References cyclic_graph(), and line::InputError::InputError().
Referenced by cyclic_graph(), and line::gen::NetworkGenerator< T >::set_topology().
|
inline |
randGraph(n): a random strongly connected digraph on n vertices, as a random spanning tree closed up by strongConnect and then relabelled by a random permutation (without which vertex 0 would always be the DFS root).
Definition at line 174 of file network_generator.h.
References line::InputError::InputError(), rand_graph(), and rand_spanning_tree().
Referenced by rand_graph(), and line::gen::NetworkGenerator< T >::set_topology().
|
inline |
randSpanningTree(n): vertex i (i >= 1) is attached to a uniformly chosen earlier vertex, which is a uniform draw over the labelled rooted trees this construction reaches, and always a tree rooted at 0.
Definition at line 103 of file network_generator.h.
References line::rng::JavaRandom::next_int(), and rand_spanning_tree().
Referenced by rand_graph(), and rand_spanning_tree().
|
inline |
randfixedsumone(n): n probabilities summing to exactly 1.
The reference's own recipe, quirks kept: n uniforms are normalised, each is rounded UP to a multiple of 1e-3 (so the rounded vector oversums), and the LARGEST entry absorbs the whole residual. Rounding to three digits is what keeps the emitted model.json readable; the absorption is what keeps the row stochastic to the last bit after it.
Definition at line 218 of file network_generator.h.
References line::rng::JavaRandom::next_double(), and randfixedsumone().
Referenced by randfixedsumone().
|
inline |
randintfixedsum(s, n): n STRICTLY POSITIVE integers summing to s.
The reference's recursion: draw the first part uniformly from 1..s-n (which leaves at least one unit for each remaining part), recurse on the rest, and shuffle so the first part carries no special distribution.
Definition at line 247 of file network_generator.h.
References line::InputError::InputError(), line::rng::JavaRandom::next_int(), and randintfixedsum().
Referenced by randintfixedsum().