![]() |
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 | MatlabRng |
| One MATLAB global random stream, as left by rng(seed). 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, MatlabRng &r) |
| randSpanningTree(n): vertex i (i >= 1) is attached to a uniformly chosen earlier vertex, randi(i) in MATLAB's 1-based terms, and always a tree rooted at 0. | |
| Matrix< double > | rand_graph (std::size_t num_vertices, MatlabRng &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, MatlabRng &r) |
| randfixedsumone(n): n probabilities summing to exactly 1. | |
| std::vector< int > | randintfixedsum (int s, int n, MatlabRng &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 187 of file network_generator.h.
References cyclic_graph(), and line::InputError::InputError().
Referenced by cyclic_graph(), and line::gen::NetworkGenerator< T >::set_topology().
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 163 of file network_generator.h.
References line::InputError::InputError(), rand_graph(), rand_spanning_tree(), and line::gen::MatlabRng::randperm().
Referenced by rand_graph(), and line::gen::NetworkGenerator< T >::set_topology().
randSpanningTree(n): vertex i (i >= 1) is attached to a uniformly chosen earlier vertex, randi(i) in MATLAB's 1-based terms, and always a tree rooted at 0.
Definition at line 102 of file network_generator.h.
References rand_spanning_tree(), and line::gen::MatlabRng::randi().
Referenced by rand_graph(), and rand_spanning_tree().
|
inline |
randfixedsumone(n): n probabilities summing to exactly 1.
The reference's own recipe, quirks kept: a uniform point of the simplex from Stafford's randfixedsum (which draws even at n = 1), each entry rounded UP to a multiple of 1e-3 (so the rounded vector oversums), and the FIRST LARGEST entry absorbing the whole residual. Rounding to three digits is what keeps the emitted model.json readable; the absorption keeps the row stochastic after it.
Definition at line 208 of file network_generator.h.
References line::gen::MatlabRng::randfixedsum(), 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) and recurse on the rest. There is no shuffle here: genCSMask permutes the result with randperm.
Definition at line 231 of file network_generator.h.
References line::InputError::InputError(), line::gen::MatlabRng::randi(), and randintfixedsum().
Referenced by randintfixedsum().