LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
nodes.h File Reference

The model API a user writes, spelled as its Python twin. More...

#include <cstddef>
#include <map>
#include <string>
#include <vector>
#include "line/lang/lang_types.h"
#include "line/lang/qn/network_builder.h"
Include dependency graph for nodes.h:

Go to the source code of this file.

Classes

class  line::Node
 A node of the model: the index it was given, and the model that owns it. More...
class  line::Station
 A node that holds jobs and serves them: MATLAB's Station. More...
class  line::Queue
 Queue(model, name, strategy). More...
class  line::Delay
 Delay(model, name): the infinite-server station. More...
class  line::Source
 Source(model, name): the external arrival station. More...
class  line::Sink
 Sink(model, name): the external departure node, which holds no jobs. More...
class  line::Router
 Router(model, name): a stateless routing node. More...
class  line::ClassSwitch
 ClassSwitch(model, name, C). More...
class  line::Fork
 Fork(model, name). More...
class  line::Join
 Join(model, name, fork). More...
class  line::Cache
 Cache(model, name, params). More...
class  line::Place
 Place(model, name): a Petri-net place. More...
class  line::Transition
 Transition(model, name, params): a Petri-net transition. More...
class  line::JobClass
 A job class: the index it was given, and the model that owns it. More...
class  line::ClosedClass
 ClosedClass(model, name, njobs, refstat, prio). More...
class  line::OpenClass
 OpenClass(model, name, prio). More...
class  line::SelfLoopingClass
 SelfLoopingClass(model, name, njobs, refstat, prio). More...

Namespaces

namespace  line

Typedefs

typedef qn::Network< double > line::NetworkModel
typedef qn::RoutingMatrix< double > line::Routing
typedef lang::Distrib< double > line::Dist

Functions

void line::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.
void line::serial_routing (Routing &P, std::size_t r, const std::vector< std::size_t > &nodes)
 Network.serialRouting(nodes) on one class of a model.
void line::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.

Detailed Description

The model API a user writes, spelled as its Python twin.

Network model("model");
Delay  delay (model, "Delay");
Queue  queue1(model, "Queue1", SchedStrategy::PS);
Source source(model, "Source");
Sink   sink  (model, "Sink");
ClosedClass closed(model, "ClosedClass", 2, delay, 0);
queue1.set_service(closed, Exp(1.0));

against Python's

model  = Network('model')
delay  = Delay(model, 'Delay')
queue1 = Queue(model, 'Queue1', SchedStrategy.PS)
closed = ClosedClass(model, 'ClosedClass', 2, delay, 0)
queue1.set_service(closed, Exp(1.0))

EVERY CLASS HERE IS A HANDLE, NOT A NODE. It holds the model and the 1-based index qn::Network already returns, and every method forwards to the builder call of the same name – network_builder.h remains the engine and is not touched. That is what lets old and new code mix: a handle CONVERTS to its index, so it drops straight into RoutingMatrix::set and into any call still written against the index API.

The handles are double-only, as Python is. The templated qn::Network<T> stays reachable for the multiprecision paths.

Definition in file nodes.h.