![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
A random qn::Network<T> source, configured once and then drawn from. More...
#include <line/gen/network_generator.h>
Public Member Functions | |
| NetworkGenerator (long long seed=0, TopologyKind kind=TopologyKind::Rand) | |
| MATLAB's rng(seed) followed by NetworkGenerator('topologyFcn', ...): the stream is seeded FIRST and the constructor then validates the topology on a two-vertex call, as MATLAB's set.topologyFcn does, so a Random topology costs the five draws of randGraph(2) and a Cyclic one none. | |
| void | set_seed (long long seed) |
| Reseed the single stream every draw comes from, as MATLAB rng(seed). | |
| void | set_model_name (const std::string &nm) |
| The name given to the generated model. | |
| const std::string & | model_name () const |
| void | set_sched_strat (const std::string &strat) |
| fcfs, ps, inf, lcfs, lcfspr, siro, sjf, ljf, sept, lept, or randomize. | |
| const std::string & | sched_strat () const |
| void | set_routing_strat (const std::string &strat) |
| Probabilities, Random, or randomize. | |
| const std::string & | routing_strat () const |
| void | set_distribution (const std::string &d) |
| Exp, Erlang, HyperExp, or randomize. | |
| const std::string & | distribution () const |
| void | set_cclass_job_load (const std::string &load) |
| high, medium, low, or randomize: the population band of a closed class. | |
| const std::string & | cclass_job_load () const |
| void | set_varying_service_rates (bool v) |
| Service means spread over 2^-6 . | |
| bool | varying_service_rates () const |
| void | set_multi_server_queues (bool v) |
| Queues get 1..40 servers instead of exactly one. | |
| bool | multi_server_queues () const |
| void | set_random_cs_nodes (bool v) |
| Each link gets a ClassSwitch node inserted on a coin flip. | |
| bool | random_cs_nodes () const |
| void | set_multi_chain_cs (bool v) |
| Classes are partitioned into random chains and switching is confined to a chain, instead of the default "all open classes switch among themselves
and all closed classes among themselves". | |
| bool | multi_chain_cs () const |
| void | set_topology (TopologyKind kind) |
| Pick one of the two shipped topology generators; validated like set_topology_fcn. | |
| void | set_topology_fcn (const std::function< Matrix< double >(std::size_t, MatlabRng &)> &fcn) |
| A custom topology: any function from a vertex count (and the generator's own stream, so a custom topology stays reproducible too) to a square 0/1 adjacency matrix. | |
| qn::Network< T > | generate (int num_queues, int num_delays, int num_oclass, int num_cclass) |
| The full form. | |
| qn::Network< T > | generate (int num_queues, int num_delays, int num_oclass) |
| generate(numQueues, numDelays, numOClass), closed-class count drawn 1..4. | |
| qn::Network< T > | generate (int num_queues, int num_delays) |
| generate(numQueues, numDelays), no open classes. | |
| qn::Network< T > | generate (int num_queues) |
| generate(numQueues), delays decided by the rule above. | |
| qn::Network< T > | generate () |
| Everything drawn: 1..8 queues, 1..4 closed classes, no open classes. | |
Static Public Member Functions | |
| static std::size_t | max_generate_attempts () |
| Resampling budget before an unsatisfiable configuration is reported. | |
A random qn::Network<T> source, configured once and then drawn from.
Every setter validates its argument against the same vocabulary the reference accepts, so a typo is an error at configuration time rather than a silently different model.
Definition at line 255 of file network_generator.h.
|
inlineexplicit |
MATLAB's rng(seed) followed by NetworkGenerator('topologyFcn', ...): the stream is seeded FIRST and the constructor then validates the topology on a two-vertex call, as MATLAB's set.topologyFcn does, so a Random topology costs the five draws of randGraph(2) and a Cyclic one none.
Definition at line 263 of file network_generator.h.
References line::gen::Rand, and set_topology().
|
inline |
Definition at line 310 of file network_generator.h.
|
inline |
Definition at line 300 of file network_generator.h.
|
inline |
Everything drawn: 1..8 queues, 1..4 closed classes, no open classes.
Definition at line 409 of file network_generator.h.
References generate().
|
inline |
generate(numQueues), delays decided by the rule above.
Definition at line 405 of file network_generator.h.
References generate().
|
inline |
generate(numQueues, numDelays), no open classes.
Definition at line 401 of file network_generator.h.
References generate().
|
inline |
generate(numQueues, numDelays, numOClass), closed-class count drawn 1..4.
Definition at line 397 of file network_generator.h.
References generate().
|
inline |
The full form.
num_delays < 0 means "decide for me", which is the reference's []: one delay when there is a single queue, otherwise a coin flip between none and one. num_cclass < 0 likewise draws 1..4, after the delays, which is MATLAB's order.
Definition at line 368 of file network_generator.h.
References line::qn::Network< T >::get_struct(), line::InputError::InputError(), and max_generate_attempts().
Referenced by generate(), generate(), generate(), generate(), and run_generate().
|
inlinestatic |
Resampling budget before an unsatisfiable configuration is reported.
Definition at line 356 of file network_generator.h.
Referenced by generate().
|
inline |
Definition at line 273 of file network_generator.h.
|
inline |
Definition at line 330 of file network_generator.h.
|
inline |
Definition at line 318 of file network_generator.h.
|
inline |
Definition at line 322 of file network_generator.h.
|
inline |
Definition at line 291 of file network_generator.h.
|
inline |
Definition at line 282 of file network_generator.h.
|
inline |
high, medium, low, or randomize: the population band of a closed class.
Definition at line 303 of file network_generator.h.
References line::InputError::InputError().
Referenced by run_generate().
|
inline |
Exp, Erlang, HyperExp, or randomize.
Definition at line 294 of file network_generator.h.
References line::InputError::InputError().
Referenced by run_generate().
|
inline |
The name given to the generated model.
nw is the reference's.
Definition at line 272 of file network_generator.h.
Referenced by run_generate().
|
inline |
Classes are partitioned into random chains and switching is confined to a chain, instead of the default "all open classes switch among themselves and all closed classes among themselves".
Definition at line 329 of file network_generator.h.
Referenced by run_generate().
|
inline |
Queues get 1..40 servers instead of exactly one.
Definition at line 317 of file network_generator.h.
Referenced by run_generate().
|
inline |
Each link gets a ClassSwitch node inserted on a coin flip.
Definition at line 321 of file network_generator.h.
Referenced by run_generate().
|
inline |
Probabilities, Random, or randomize.
Definition at line 285 of file network_generator.h.
References line::InputError::InputError().
Referenced by run_generate().
|
inline |
fcfs, ps, inf, lcfs, lcfspr, siro, sjf, ljf, sept, lept, or randomize.
Definition at line 276 of file network_generator.h.
References line::InputError::InputError().
Referenced by run_generate().
|
inline |
Reseed the single stream every draw comes from, as MATLAB rng(seed).
Definition at line 269 of file network_generator.h.
Referenced by run_generate().
|
inline |
Pick one of the two shipped topology generators; validated like set_topology_fcn.
Definition at line 333 of file network_generator.h.
References line::gen::Cyclic, line::gen::cyclic_graph(), line::gen::rand_graph(), and set_topology_fcn().
Referenced by NetworkGenerator(), and run_generate().
|
inline |
A custom topology: any function from a vertex count (and the generator's own stream, so a custom topology stays reproducible too) to a square 0/1 adjacency matrix.
Validated on a two-vertex call, as the reference does, and that call draws from the generator's own stream exactly as MATLAB's does.
Definition at line 346 of file network_generator.h.
References line::Matrix< T >::cols(), line::InputError::InputError(), and line::Matrix< T >::rows().
Referenced by set_topology().
|
inline |
Service means spread over 2^-6 .
. 2^6 instead of all being 1.
Definition at line 313 of file network_generator.h.
Referenced by run_generate().
|
inline |
Definition at line 314 of file network_generator.h.