5#ifndef LINE_LANG_QN_NODES_H
6#define LINE_LANG_QN_NODES_H
71 operator std::size_t()
const {
return idx_; }
143 :
Station(m, m.add_queue(nm, sched), nm) {}
180 :
Node(m, m.add_class_switch(nm), nm) {
193 :
Node(m, m.add_fork(nm, tasks_per_link), nm) {}
200 :
Node(m, m.add_join(nm, fork_node), nm) {}
211 :
Node(m, m.add_cache(nm, par), nm) {}
214 const std::vector<std::size_t>& hit_classes) {
233 :
Node(m, m.add_transition(nm, par), nm) {}
248 operator std::size_t()
const {
return idx_; }
263 :
JobClass(m, m.add_closed_class(nm, njobs, refstat_node, prio), nm) {}
270 :
JobClass(m, m.add_open_class(nm, prio), nm) {}
277 std::size_t refstat_node,
int prio = 0)
278 :
JobClass(m, m.add_self_looping_class(nm, njobs, refstat_node, prio), nm) {}
287 const std::vector<std::size_t>& nodes) {
288 for (std::size_t k = 0; k + 1 < nodes.size(); ++k) P.
set(r, s, nodes[k], nodes[k + 1], 1.0);
299 if (nodes.size() > 1) P.
set(r, r, nodes.back(), nodes.front(), 1.0);
Cache(NetworkModel &m, const std::string &nm, const qn::CacheParam< double > &par)
void set_item_read_classes(const std::vector< std::size_t > &read_classes, const std::vector< std::size_t > &hit_classes)
setItemReadClasses(read_classes, hit_classes), one entry per item.
void set_class_switching_matrix(const Matrix< double > &C)
setClassSwitchingMatrix(C).
ClassSwitch(NetworkModel &m, const std::string &nm, const Matrix< double > &C)
ClosedClass(NetworkModel &m, const std::string &nm, double njobs, std::size_t refstat_node, int prio=0)
Delay(NetworkModel &m, const std::string &nm)
Fork(NetworkModel &m, const std::string &nm, double tasks_per_link=1.0)
JobClass(NetworkModel &m, std::size_t idx, const std::string &nm)
const std::string & get_name() const
getName().
std::size_t get_index() const
get_index(): the 1-based class index.
void set_strategy(lang::JoinStrategy strategy, double quorum=0.0)
setStrategy(strategy, quorum).
Join(NetworkModel &m, const std::string &nm, std::size_t fork_node)
Node(NetworkModel &m, std::size_t idx, const std::string &nm)
void set_routing(std::size_t cls, lang::RoutingStrategy rs)
setRouting(class, strategy).
NetworkModel & model() const
The model this node belongs to.
std::size_t get_index() const
get_index(): the 1-based node index the builder assigned.
void set_routing_weights(std::size_t cls, const std::map< std::size_t, double > &weights)
setRoutingWeight(class, weights): the WRROBIN share per destination.
const std::string & get_name() const
getName().
OpenClass(NetworkModel &m, const std::string &nm, int prio=0)
void set_initial_marking(const std::vector< double > &tokens)
setInitialMarking(tokens).
Place(NetworkModel &m, const std::string &nm)
Queue(NetworkModel &m, const std::string &nm, lang::SchedStrategy sched=lang::SchedStrategy::FCFS)
Router(NetworkModel &m, const std::string &nm)
SelfLoopingClass(NetworkModel &m, const std::string &nm, double njobs, std::size_t refstat_node, int prio=0)
Sink(NetworkModel &m, const std::string &nm)
void set_arrival_batch(std::size_t cls, const Dist &d)
setArrivalBatch(class, batchSizeDist).
void set_arrival(std::size_t cls, const Dist &d)
setArrival(class, distribution).
Source(NetworkModel &m, const std::string &nm)
void add_server_type(const qn::Station< double >::ServerType &stype)
addServerType(type): one pool of a heterogeneous station.
void set_breakdown(const Dist &failure, const Dist &repair)
setBreakdown(failure, repair).
void set_polling_type(lang::PollingType rule, int par=0)
setPollingType(type, k).
Station(NetworkModel &m, std::size_t idx, const std::string &nm)
void set_capacity(double k)
setCapacity(k), the K of Kendall's notation.
void set_service(std::size_t cls, const Dist &d)
setService(class, distribution).
void set_sched_param(std::size_t cls, double weight)
setSchedParam(class, weight): the DPS/GPS share.
void set_class_capacity(std::size_t cls, double k)
setClassCapacity(class, k).
std::size_t get_station_index() const
getStationIndex(): the 1-based station index, distinct from the node one.
void set_drop_rule(std::size_t cls, lang::DropStrategy rule)
setDropRule(class, rule).
void set_number_of_servers(double n)
setNumberOfServers(n).
void set_load_dependence(const std::vector< double > &alpha)
setLoadDependence(alpha).
void set_switchover(std::size_t cls, const Dist &so)
setSwitchover(class, distribution).
Transition(NetworkModel &m, const std::string &nm, const qn::TransitionParam< double > &par)
A queueing network under construction.
void set_drop_rule(std::size_t node, std::size_t cls, DropStrategy rule)
station.setDropRule(class, rule).
void set_load_dependence(std::size_t node, const std::vector< T > &alpha)
station.setLoadDependence(alpha): the rate multiplier at population 1, 2, ... The vector is indexed f...
void set_class_capacity(std::size_t node, std::size_t cls, double k)
station.setChainCapacity(class, k).
void set_arrival_batch(std::size_t node, std::size_t cls, const Distrib< T > &dist)
Source.setArrivalBatch(class, dist): the batch-size law released at each arrival epoch.
void set_initial_marking(std::size_t node, const std::vector< T > &tokens)
Place.setState(marking): the initial token count of the place, per class.
void set_number_of_servers(std::size_t node, double n)
queue.setNumberOfServers(n).
void set_class_switch_matrix(std::size_t node, const Matrix< T > &C)
Install the switching matrix of a ClassSwitch created without one.
void set_routing(std::size_t node, std::size_t cls, RoutingStrategy rs)
node.setRouting(class, strategy).
void set_join_strategy(std::size_t node, lang::JoinStrategy strategy, double quorum=0.0)
Join.setStrategy(...): STD waits for every sibling, PARTIAL for a quorum.
void set_sched_param(std::size_t node, std::size_t cls, const T &weight)
The DPS / GPS weight of a class at a station.
void set_routing_weights(std::size_t node, std::size_t cls, const std::map< std::size_t, double > &weights)
The per-destination weights of a WRROBIN dispatcher, per (node, class).
void set_capacity(std::size_t node, double k)
station.setCapacity(k), the K of Kendall's notation.
void set_switchover(std::size_t node, std::size_t cls, const Distrib< T > &so)
Queue.setSwitchover(jobclass, distrib): the switchover time of a class.
void add_server_type(std::size_t node, const typename Station< T >::ServerType &stype)
Queue.addServerType(...): one heterogeneous server pool of the station.
void set_service(std::size_t node, std::size_t cls, const Distrib< T > &d)
station.setService(class, dist).
void set_breakdown(std::size_t node, const Distrib< T > &failure, const Distrib< T > &repair, const std::vector< Distrib< T > > &down_service=std::vector< Distrib< T > >())
Queue.setBreakdown(failure, repair, downService): the server alternates up and down on the two clocks...
void set_item_read_classes(std::size_t cache_node, const std::vector< std::size_t > &read_classes, const std::vector< std::size_t > &hit_classes)
Cache.setItemReadClasses(readClasses, hitClasses): declare that read_classes[i] is the request stream...
std::size_t station_index(std::size_t node) const
void set_arrival(std::size_t node, std::size_t cls, const Distrib< T > &d)
source.setArrival(class, dist): the same table, at the Source.
void set_polling_type(std::size_t node, lang::PollingType rule, int par=0)
Queue.setPollingType(rule, par): the polling discipline of a POLLING station, identical across all cl...
The routing matrix a model script fills in, MATLAB's P cell array.
void set(std::size_t r, std::size_t s, std::size_t i, std::size_t j, const T &p)
Enumerations and the minimal distribution descriptor shared by the model layer of the C++ port.
SchedStrategy
Scheduling disciplines, with the values of MATLAB SchedStrategy.
DropStrategy
Blocking and loss rules, with the values of MATLAB DropStrategy.
JoinStrategy
Join rules, with the values of MATLAB JoinStrategy.
RoutingStrategy
Routing strategies, with the values of MATLAB RoutingStrategy.
PollingType
Polling service disciplines, with the values of MATLAB PollingType.
lang::Distrib< double > Dist
qn::Network< double > NetworkModel
void cyclic_routing(Routing &P, std::size_t r, const std::vector< std::size_t > &nodes)
The same chain closed into a cycle, which is how a closed model circulates.
qn::RoutingMatrix< double > Routing
void serial_routing(Routing &P, std::size_t r, std::size_t s, const std::vector< std::size_t > &nodes)
Network.serialRouting(nodes) for one class pair: 1 -> 2 -> ... -> n.
The Network constructor API: Queue, Delay, Source, Sink, Router, ClassSwitch, Cache,...
A heterogeneous server pool: count servers that serve only compatible classes, each with its own serv...
The parameters of a Cache node, MATLAB's sn.nodeparam{ind} for a Cache.