LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
line::gen::NetworkGenerator< T > Class Template Reference

A random qn::Network<T> source, configured once and then drawn from. More...

#include <line/gen/network_generator.h>

Public Member Functions

 NetworkGenerator ()
 NetworkGenerator (long long seed)
void set_seed (long long seed)
 Reseed the single stream every draw comes from.
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.
void set_topology_fcn (const std::function< Matrix< double >(std::size_t, rng::JavaRandom &)> &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.

Detailed Description

template<class T>
class line::gen::NetworkGenerator< T >

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 276 of file network_generator.h.

Constructor & Destructor Documentation

◆ NetworkGenerator() [1/2]

template<class T>
line::gen::NetworkGenerator< T >::NetworkGenerator ( )
inline

Definition at line 278 of file network_generator.h.

◆ NetworkGenerator() [2/2]

template<class T>
line::gen::NetworkGenerator< T >::NetworkGenerator ( long long seed)
inlineexplicit

Definition at line 279 of file network_generator.h.

Member Function Documentation

◆ cclass_job_load()

template<class T>
const std::string & line::gen::NetworkGenerator< T >::cclass_job_load ( ) const
inline

Definition at line 323 of file network_generator.h.

◆ distribution()

template<class T>
const std::string & line::gen::NetworkGenerator< T >::distribution ( ) const
inline

Definition at line 313 of file network_generator.h.

◆ generate() [1/5]

template<class T>
qn::Network< T > line::gen::NetworkGenerator< T >::generate ( )
inline

Everything drawn: 1..8 queues, 1..4 closed classes, no open classes.

Definition at line 420 of file network_generator.h.

References generate().

◆ generate() [2/5]

template<class T>
qn::Network< T > line::gen::NetworkGenerator< T >::generate ( int num_queues)
inline

generate(numQueues), delays decided by the rule above.

Definition at line 416 of file network_generator.h.

References generate().

◆ generate() [3/5]

template<class T>
qn::Network< T > line::gen::NetworkGenerator< T >::generate ( int num_queues,
int num_delays )
inline

generate(numQueues, numDelays), no open classes.

Definition at line 412 of file network_generator.h.

References generate().

◆ generate() [4/5]

template<class T>
qn::Network< T > line::gen::NetworkGenerator< T >::generate ( int num_queues,
int num_delays,
int num_oclass )
inline

generate(numQueues, numDelays, numOClass), closed-class count drawn 1..4.

Definition at line 408 of file network_generator.h.

References generate().

◆ generate() [5/5]

template<class T>
qn::Network< T > line::gen::NetworkGenerator< T >::generate ( int num_queues,
int num_delays,
int num_oclass,
int num_cclass )
inline

The full form.

num_delays < 0 means "decide for me", which is the reference's null: one delay when there is a single queue, otherwise a coin flip between none and one.

Definition at line 380 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().

◆ max_generate_attempts()

template<class T>
std::size_t line::gen::NetworkGenerator< T >::max_generate_attempts ( )
inlinestatic

Resampling budget before an unsatisfiable configuration is reported.

Definition at line 369 of file network_generator.h.

Referenced by generate().

◆ model_name()

template<class T>
const std::string & line::gen::NetworkGenerator< T >::model_name ( ) const
inline

Definition at line 286 of file network_generator.h.

◆ multi_chain_cs()

template<class T>
bool line::gen::NetworkGenerator< T >::multi_chain_cs ( ) const
inline

Definition at line 343 of file network_generator.h.

◆ multi_server_queues()

template<class T>
bool line::gen::NetworkGenerator< T >::multi_server_queues ( ) const
inline

Definition at line 331 of file network_generator.h.

◆ random_cs_nodes()

template<class T>
bool line::gen::NetworkGenerator< T >::random_cs_nodes ( ) const
inline

Definition at line 335 of file network_generator.h.

◆ routing_strat()

template<class T>
const std::string & line::gen::NetworkGenerator< T >::routing_strat ( ) const
inline

Definition at line 304 of file network_generator.h.

◆ sched_strat()

template<class T>
const std::string & line::gen::NetworkGenerator< T >::sched_strat ( ) const
inline

Definition at line 295 of file network_generator.h.

◆ set_cclass_job_load()

template<class T>
void line::gen::NetworkGenerator< T >::set_cclass_job_load ( const std::string & load)
inline

high, medium, low, or randomize: the population band of a closed class.

Definition at line 316 of file network_generator.h.

References line::InputError::InputError().

Referenced by run_generate().

◆ set_distribution()

template<class T>
void line::gen::NetworkGenerator< T >::set_distribution ( const std::string & d)
inline

Exp, Erlang, HyperExp, or randomize.

Definition at line 307 of file network_generator.h.

References line::InputError::InputError().

Referenced by run_generate().

◆ set_model_name()

template<class T>
void line::gen::NetworkGenerator< T >::set_model_name ( const std::string & nm)
inline

The name given to the generated model.

nw is the reference's.

Definition at line 285 of file network_generator.h.

Referenced by run_generate().

◆ set_multi_chain_cs()

template<class T>
void line::gen::NetworkGenerator< T >::set_multi_chain_cs ( bool v)
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 342 of file network_generator.h.

Referenced by run_generate().

◆ set_multi_server_queues()

template<class T>
void line::gen::NetworkGenerator< T >::set_multi_server_queues ( bool v)
inline

Queues get 1..40 servers instead of exactly one.

Definition at line 330 of file network_generator.h.

Referenced by run_generate().

◆ set_random_cs_nodes()

template<class T>
void line::gen::NetworkGenerator< T >::set_random_cs_nodes ( bool v)
inline

Each link gets a ClassSwitch node inserted on a coin flip.

Definition at line 334 of file network_generator.h.

Referenced by run_generate().

◆ set_routing_strat()

template<class T>
void line::gen::NetworkGenerator< T >::set_routing_strat ( const std::string & strat)
inline

Probabilities, Random, or randomize.

Definition at line 298 of file network_generator.h.

References line::InputError::InputError().

Referenced by run_generate().

◆ set_sched_strat()

template<class T>
void line::gen::NetworkGenerator< T >::set_sched_strat ( const std::string & strat)
inline

fcfs, ps, inf, lcfs, lcfspr, siro, sjf, ljf, sept, lept, or randomize.

Definition at line 289 of file network_generator.h.

References line::InputError::InputError().

Referenced by run_generate().

◆ set_seed()

template<class T>
void line::gen::NetworkGenerator< T >::set_seed ( long long seed)
inline

Reseed the single stream every draw comes from.

Definition at line 282 of file network_generator.h.

Referenced by run_generate().

◆ set_topology()

template<class T>
void line::gen::NetworkGenerator< T >::set_topology ( TopologyKind kind)
inline

Pick one of the two shipped topology generators.

Definition at line 346 of file network_generator.h.

References line::gen::Cyclic, line::gen::cyclic_graph(), and line::gen::rand_graph().

Referenced by run_generate().

◆ set_topology_fcn()

template<class T>
void line::gen::NetworkGenerator< T >::set_topology_fcn ( const std::function< Matrix< double >(std::size_t, rng::JavaRandom &)> & fcn)
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.

Definition at line 358 of file network_generator.h.

References line::Matrix< T >::cols(), line::InputError::InputError(), and line::Matrix< T >::rows().

◆ set_varying_service_rates()

template<class T>
void line::gen::NetworkGenerator< T >::set_varying_service_rates ( bool v)
inline

Service means spread over 2^-6 .

. 2^6 instead of all being 1.

Definition at line 326 of file network_generator.h.

Referenced by run_generate().

◆ varying_service_rates()

template<class T>
bool line::gen::NetworkGenerator< T >::varying_service_rates ( ) const
inline

Definition at line 327 of file network_generator.h.


The documentation for this class was generated from the following file: